components icon indicating copy to clipboard operation
components copied to clipboard

Add the possibility to toggle on/off keyboard shortcuts.

Open furstenberg opened this issue 1 year ago โ€ข 0 comments

Provide a general summary of the feature here

When we have added keyboard shortcuts as seen here: https://storybook.sanomalearning.design/?path=/story/overlay-menu--shortcut we should have an option to let the user turn it off.

๐Ÿค” Expected Behavior?

If the user has selected to turn off keyboard shortcuts, we should not show them in the UI nor act on them.

๐Ÿ˜ฏ Current Behavior

As I understand it, it cannot be turned off now.

๐Ÿ’ Possible Solution

A simple property "enableKeyboardShortcuts" should do it.

๐Ÿ”ฆ Context

If the user has selected to turn off keyboard shortcuts, we should have the possibility to turn them off in the component. A user would typically do this if it conflicts with other existing keyboard shortcuts.

There is even a somewhat related wcag criteria regarding this: https://www.w3.org/TR/WCAG22/#character-key-shortcuts

It's meant for single key shortcuts, but it's common for many accessibility tools to have a wide array of keyboard shortcuts. So we could easily conflict with such a tool.

As part of WCAG 2.2 and the new understanding of respecting user choice when it comes to EN 301 549, itslearning plans to have several options for users to change existing behaviour and defaults. (typography, colours, font-sizes etc)

๐Ÿ’ป Examples

No response

๐Ÿงข Your Product/Team

Itslearning

### Tasks
- [ ] find a way to update user preferences/config at runtime
- [ ] update menu to respect the enablekeyboard property
- [ ] Add property "enableKeyboardShortcuts"
- [ ] Update documentation

furstenberg avatar Aug 20 '24 12:08 furstenberg