UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

2 lines (1 loc) 755 B
import"./chunk-L67DAW3A.js";var c="ion-focused",u="ion-focusable",f=["Tab","ArrowDown","Space","Escape"," ","Shift","Enter","ArrowLeft","ArrowRight","ArrowUp"],d=function(){var a=[],r=!0,t=document,e=function(n){a.forEach(function(o){return o.classList.remove(c)}),n.forEach(function(o){return o.classList.add(c)}),a=n},s=function(){r=!1,e([])};t.addEventListener("keydown",function(n){r=f.includes(n.key),r||e([])}),t.addEventListener("focusin",function(n){if(r&&n.composedPath){var o=n.composedPath().filter(function(i){return i.classList?i.classList.contains(u):!1});e(o)}}),t.addEventListener("focusout",function(){t.activeElement===t.body&&e([])}),t.addEventListener("touchstart",s),t.addEventListener("mousedown",s)};export{d as startFocusVisible};