feat(core,nodes): implement a11y in nodes

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2022-12-20 00:38:56 +01:00
committed by Braks
parent 0267b2f19e
commit 9f50dd0865
17 changed files with 167 additions and 35 deletions
+1 -2
View File
@@ -2,12 +2,11 @@ import type { Ref } from 'vue'
import type { KeyFilter, MaybeRef } from '@vueuse/core'
import { isBoolean, isFunction } from '@vueuse/core'
function isInputDOMNode(event: KeyboardEvent): boolean {
export function isInputDOMNode(event: KeyboardEvent): boolean {
const target = (event.composedPath?.()?.[0] || event.target) as HTMLElement
// we want to be able to do a multi selection event if we are in an input field
if (event.ctrlKey || event.metaKey || event.shiftKey) return false
const hasAttribute = isFunction(target.hasAttribute) ? target.hasAttribute('contenteditable') : false
const closest = isFunction(target.closest) ? target.closest('.nokey') : null