Skip to content

fix: Fix scrolling of menus on mobile.#6911

Merged
gonfunko merged 1 commit into
RaspberryPiFoundation:developfrom
gonfunko:mobile-menus
Mar 20, 2023
Merged

fix: Fix scrolling of menus on mobile.#6911
gonfunko merged 1 commit into
RaspberryPiFoundation:developfrom
gonfunko:mobile-menus

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Fixes #6759

Proposed Changes

The menu item selection handler is triggered on pointerup vs down.

Behavior Before Change

Attempting to scroll a menu on mobile would select the item that was tapped to initiate the scroll.

Behavior After Change

Menus can be scrolled as expected, and tapping an item selects it.

@gonfunko gonfunko requested a review from a team as a code owner March 20, 2023 19:41
@gonfunko gonfunko requested a review from maribethb March 20, 2023 19:41
@github-actions github-actions Bot added the PR: fix Fixes a bug label Mar 20, 2023

@maribethb maribethb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking for my own understanding-
when you scroll, it doesn't select the item you're hovering over when you stop scrolling and lift your finger, right? and that works because the browser is smart enough to issue a pointercancel event once the element is scrolled? I couldn't find Blockly-specific code that's cancelling it but after a quick review of the pointer events spec that's what I think is happening, and wanted to confirm that's your understanding as well.

@gonfunko

Copy link
Copy Markdown
Contributor Author

Correct, experimentally it behaves as you describe/would expect - the item you let up on isn't selected, you have to tap (separate from initiating/ending the scroll) to select one.

@gonfunko gonfunko merged commit cbb3829 into RaspberryPiFoundation:develop Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to scroll dropdown field on touch devices.

2 participants