Skip to content

Commit

Permalink
#2646: disable tab when actions menu is open, when closed return focu…
Browse files Browse the repository at this point in the history
…s to the actions button
  • Loading branch information
sudo-may committed Jul 26, 2024
1 parent 4e0b131 commit 2c46b2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dashboard-prime/src/components/skills/SkillsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,20 @@ function handleKeyDown(event) {
// tab=9
if (event.keyCode === 9) {
event.preventDefault();
if (actionMenuFocused.value) {
focusState.focusOnLastElement()
}
}
}
const actionMenuFocused = ref(false)
const actionMenuOnFocus = () => {
actionMenuFocused.value = true
document.addEventListener('keydown', handleKeyDown);
}
const actionMenuOnBlur = () => {
actionMenuFocused.value = false
document.removeEventListener('keydown', handleKeyDown);
focusState.focusOnLastElement()
}
// done with actions fix
Expand Down

0 comments on commit 2c46b2b

Please sign in to comment.