Skip to content
New issue

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

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

Already on GitHub? # to your account

uui-swatch: selection no longer works with space key #654

Closed
bjarnef opened this issue Nov 8, 2023 · 4 comments · Fixed by #958
Closed

uui-swatch: selection no longer works with space key #654

bjarnef opened this issue Nov 8, 2023 · 4 comments · Fixed by #958
Labels
accessibility A11Y improvements bug Something isn't working community/hackathon community/up-for-grabs needs triage This issue has not been tested by a team member yet

Comments

@bjarnef
Copy link
Contributor

bjarnef commented Nov 8, 2023

Which exact UI Library version are you using? For example: 1.0.1 - don't just write v1.

1.6.0-rc

Bug summary

The selection of the swatch used to be possible using the space key, but doesn't seem to work anywork.
I noticed in with 1.6.0-rc in backoffice, but also seems to be the case here:
https://uui.umbraco.com/?path=/story/uui-color-swatches--overview

chrome_yWn3Lq99dU.mp4

Specifics

No response

Steps to reproduce

Try make a selection of in uui-swatch or a swatch in uui-swatches using keyboard and hit space key to select.
It seems to uncheck right away.

Expected result / actual result

No response

@bjarnef bjarnef added bug Something isn't working needs triage This issue has not been tested by a team member yet labels Nov 8, 2023
@bjarnef
Copy link
Contributor Author

bjarnef commented Nov 15, 2023

Actually it seems to be an issue in both latest version and 1.6.0-rc

I can reproduce in both of these examples, with a single hit on space key.

#536 (comment)

However if holding space key down sometimes the swatch is selected, sometimes not and toggle fast between selection. I think the issue is it react on keypress and not on keyup, when releasing the key.

@bjarnef
Copy link
Contributor Author

bjarnef commented Nov 15, 2023

@iOvergaard @nielslyngsoe I think the root cause to this, may be how the selectable mixin works?

this.addEventListener('keydown', this.handleSelectKeydown);

@bjarnef
Copy link
Contributor Author

bjarnef commented Nov 15, 2023

I can also reproduce on selectable cards:
https://uui.umbraco.com/?path=/story/uui-card-media--selectable

Holding down space key toggle the selection - in my opinion first when key is released (keyup event).

@nielslyngsoe
Copy link
Member

Hi @bjarnef

I agree, you should be able to use spacebar to select.

Feel free to make PR, please make a new PR for each component.

Thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
accessibility A11Y improvements bug Something isn't working community/hackathon community/up-for-grabs needs triage This issue has not been tested by a team member yet
Projects
None yet
2 participants