fix(core): prevent esc keypress when a11y is disabled

This commit is contained in:
braks
2024-02-21 23:27:01 +01:00
committed by Braks
parent e5a84656ad
commit f815ef6dd5
2 changed files with 4 additions and 3 deletions
@@ -44,6 +44,7 @@ const EdgeWrapper = defineComponent({
findNode,
isValidConnection,
multiSelectionActive,
disableKeyboardA11y,
} = useVueFlow()
const hooks = useEdgeHooks(props.edge, emits)
@@ -334,7 +335,7 @@ const EdgeWrapper = defineComponent({
}
function onKeyDown(event: KeyboardEvent) {
if (elementSelectionKeys.includes(event.key) && props.selectable) {
if (!disableKeyboardA11y.value && elementSelectionKeys.includes(event.key) && props.selectable) {
const unselect = event.key === 'Escape'
if (unselect) {