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

[full-ci] Keyboard navigation disable for inputs #7648

Merged
merged 4 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/unreleased/enhancement-make-keybindings-global
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Enhancement: Make keybindings global
We've made keybindings global and introduced a data-attribute to mark elements that need custom keybindings

https://github.com/owncloud/web/pull/7569
https://github.com/owncloud/web/pull/7648
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export default defineComponent({
}),

areCustomKeyBindingsEnabled() {
const activeElementTag = document.activeElement.tagName
if (['textarea', 'input', 'select'].includes(activeElementTag.toLowerCase())) return true
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally not a fan of the inline return without {}

Copy link
Member

Choose a reason for hiding this comment

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

Same. Code style in web and related repos is to not inline return statements.

Copy link
Contributor

Choose a reason for hiding this comment

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

Tried to find a eslint rule set plugin, but nothing found unfortantly

const closestSelectionEl = window.getSelection().focusNode as HTMLElement
if (!closestSelectionEl) return false
let customKeyBindings
Expand Down