Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

fix(slider): fix slider usability on touch devices #914

Merged
merged 3 commits into from
Jan 10, 2022

Conversation

andy-blum
Copy link
Member

Related Ticket(s)

Fixes #830

Description

This PR makes several usability improvements to the slider component:

  • Converts all mouseevent listeners to pointerevent listeners, and adds an inline style of touch-action: none; to the slider thumb control while this._dragging == true.
  • Moves and renames the KeydownThumb event handler to the slider root
  • Changes handleMousedownTrack to handleClick and moves listener from track element to slider element to increase the clickable area with a fine pointing device such as a stylus or mouse.
  • Adds a pointerleave and pointerup listener to the slider root to cancel the dragging action.

Changelog

Changed

  • slider usability improvements

@andy-blum andy-blum requested a review from a team as a code owner December 29, 2021 21:05
@andy-blum andy-blum requested review from emyarod, IgnacioBecerra and JBrandwine and removed request for a team December 29, 2021 21:05
@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Dec 29, 2021

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Dec 29, 2021

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me! slider has much better usability on mobile now

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Jan 6, 2022

@ibmdotcom-bot
Copy link
Contributor

ibmdotcom-bot commented Jan 7, 2022

@jeffchew jeffchew added the Ready to merge Label for the pull requests that are ready to merge label Jan 10, 2022
@kodiakhq kodiakhq bot merged commit fb119bb into carbon-design-system:main Jan 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ready to merge Label for the pull requests that are ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slider doesn't work on touch devices
4 participants