-
Notifications
You must be signed in to change notification settings - Fork 55
uui-color: add better support for touch screens #532
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
uui-color: add better support for touch screens #532
Conversation
…a-always-reset-hue-to-zero
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-532.westeurope.azurestaticapps.net |
1 similar comment
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-532.westeurope.azurestaticapps.net |
Hi @iOvergaard from the generated Azure app it looks okay regarding the issue and in the color area dragging the handle is smooth. But it seems also to happen on uui.umbraco.com so probably another issue somewhere. |
Hmm, I can't really reproduce that, @bjarnef, but happy to create a new issue to investigate further. Thanks for reviewing 👍 |
…a-always-reset-hue-to-zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely on touch screeen. 👍🏻
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-532.westeurope.azurestaticapps.net |
…a-always-reset-hue-to-zero
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-532.westeurope.azurestaticapps.net |
Description
Fixes #509
Update the move() function to handle
TouchEvent
as well asPointerEvent
. When initially "clicking" on a touch screen, it will pass aTouchEvent
that does not match the signature of aPointerEvent
, specifically it will not contain thepageX
andpageY
coordinates that the move() function expects. By analyzing the event withinstanceof TouchEvent
, we can pull out the.touches[0]
object which is of typeTouch
and matches the signature ofPointerEvent
as far as we are concerned.How to test
Spin up Storybook, go to either the uui-color-picker or uui-color-area stories and perform click, drag, and touch actions and see that it forwards a CHANGE event in the Actions tab. Specifically, the
saturation
andlightness
properties of thesrcElement
should reflect what has happened, and visually the dot should have moved to where you clicked in the color area.