Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js check that interactive element is not focused

const el = event.target as Element | undefined
const interactiveElementIsFocused = el.closest(
      'a, button, input, label, [contenteditable=true], [aria-haspopup], [role="dialog"], [role="button"]'
    ) !== null
 
PREVIOUS NEXT
Tagged: #js #check #interactive #element #focused
ADD COMMENT
Topic
Name
5+7 =