Skip to content

Slider Examples: Move the thumb on pointer down when the rail is pressed - #3477

Open
Ritesh7202 wants to merge 2 commits into
w3c:mainfrom
Ritesh7202:slider-rail-pointerdown
Open

Ritesh7202 wants to merge 2 commits into
w3c:mainfrom
Ritesh7202:slider-rail-pointerdown

Conversation

@Ritesh7202

Copy link
Copy Markdown

Resolves #2446

The color viewer and rating sliders only moved the thumb once the pointer moved or was released, and the temperature and seek sliders only moved it on the click event after release. This made it impossible to cancel a press on the rail and was inconsistent with the native range input.

Pressing the rail now moves the thumb to the pointer position immediately and keeps tracking the pointer until it is released, in all four examples. Pressing the thumb itself still starts a drag without jumping.

Changes:

  • slider-color-viewer.js: one pointerdown handler on the slider replaces the rail click handler; the value maths moved into getValueFromPointer. Presses on the thumb or its focus ring do not jump.
  • slider-temperature.js and slider-seek.js: one pointerdown handler on the SVG replaces the click handler and the separate thumb handler; seek gained a calcValue helper to match temperature.
  • slider-rating.js: the rating boxes and their number labels both handle pointerdown and pointermove, since the label text is the hit target over each box.

Keyboard behaviour is unchanged.

Testing: npm run lint:es, lint:css and lint:spelling pass. Checked in Chromium that each slider jumps on press, follows a drag, stops on release, does not jump when the thumb is pressed, and still responds to Arrow, Page Up/Down, Home and End. I could not run the Firefox regression suite locally, so I am relying on CI for it.

The color viewer and rating sliders only moved the thumb once the pointer
moved or was released, and the temperature and seek sliders only moved it
on the click event after release. Pressing the rail now moves the thumb to
the pointer position immediately and keeps tracking the pointer until it is
released, in all four examples, consistent with the native range input.
Pressing the thumb itself still starts a drag without jumping.

Resolves w3c#2446
@css-meeting-bot

Copy link
Copy Markdown
Member

The ARIA Authoring Practices (APG) Task Force just discussed PR 3477: Slider Examples: Move the thumb on pointer down when the rail is pressed.

The full IRC log of that discussion <Zakim> agendum 3 -- PR 3477: Slider Examples: Move the thumb on pointer down when the rail is pressed -- taken up [from agendabot]
<Jem_> github:https://github.com//pull/3477
<Jem_> mck: I am surprised that this was not done. Yuji, Can you review this PR?
<Jem_> s/pr/pr3477/
<Jem_> zakim, take up item 5

@mcking65

Copy link
Copy Markdown
Contributor

@jongund @wizzyfx

To review this as we discussed in last week's meeting, you will have to look at it locally for now. I have had problems generating a preview due to recent changes in the repo workflows. See my comment in #3490.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color Viewer and Rating Slider examples: Thumb should move on down event when rail is clicked

3 participants