Skip to content
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

Add keyboard support to the new SettingsPanel design #684

Open
wants to merge 10 commits into
base: feature/improve-click-handling-on-touch-devices
Choose a base branch
from

Conversation

stonko1994
Copy link
Collaborator

Description

The new SettingsPanel design doesn't support keyboard interactions yet. In the old layout this was handled by the browser as we used SelectBoxes. Since we switched to a custom element in the new layout we need to add the keyboard support manually.

This PR introduces a new InteractiveSubtitleSettingsPanelItem, adding key listeners that trigger the existing click event. The new type is used as super type for the DynamicSettingsPanelItem and the SettingsPanelSelectOption.

@if $inset == false {
box-shadow: $focus-element-box-shadow;
} @else {
box-shadow: inset $focus-element-box-shadow;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The box shadow has to be inset for settings panel items as otherwise it is not visible (they are at the edge of the settings panel and it has the overflow hidden)

@@ -129,6 +129,10 @@ export class Container<Config extends ContainerConfig> extends Component<Config>
'aria-label': i18n.performLocalization(this.config.ariaLabel),
}, this);

if (typeof this.config.tabIndex === 'number') {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The ComponentConfig already has the tabIndex property but it's not consistently applied when creating the dom elements.

Comment on lines +80 to +82
buttonElement.on('focusin focusout', (e) => {
e.stopPropagation();
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is needed to stop bubbling of the focusin event to parents. This is a problem in the new settings panel where the subtitle settings button is inside a focusable settings panel item. Without that the focusin fires on both elements which is undesired.

Copy link
Contributor

@bitmovin-kenny bitmovin-kenny left a comment

Choose a reason for hiding this comment

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

As discussed in slack, it would be a nice to have to be able to navigate the settings panel with the arrow keys (up/down selects the row and left/right goes into/out of sub menus).

But that might be a feature for another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants