Skip to content

fix(slider): update value on mousedown instead of click #13020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Sep 7, 2018

Currently the slider updates its value on the click event or when the user drags for at least one pixel. This looks weird, because the thumb label shows up as soon as the user puts down their pointer, but the value updates only if they lift it or they start dragging. There will always be a value update, because the user can't move their pointer outside the element without either lifting it or triggering the drag event.

Furthermore, the native input type="range" updates its value on mousedown as well and doing so makes the slider feel snappier.

Currently the slider updates its value on the `click` event or when the user drags for at least one pixel. This looks weird, because the thumb label shows up as soon as the user puts down their pointer, but the value updates only if they lift it or they start dragging. There will always be a value update, because the user can't move their pointer outside the element without either lifting it or triggering the drag event.

Furthermore, the native `input type="range"` updates its value on `mousedown` as well and doing so makes the slider feel snappier.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Sep 7, 2018
@crisbeto crisbeto requested a review from mmalerba as a code owner September 7, 2018 09:21
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 7, 2018
@mmalerba
Copy link
Contributor

mmalerba commented Sep 7, 2018

This would probably have to be a major change since it affects the timing of events in a way that's likely to break tests and maybe even actual code

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Sep 7, 2018
@crisbeto crisbeto added target: patch This PR is targeted for the next patch release and removed target: major This PR is targeted for the next major release labels Oct 18, 2018
@josephperrott josephperrott merged commit 861642c into angular:master Oct 19, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants