XiongAmao / vue-easy-lightbox

A tiny lightbox component for Vue.js 3.0 :tada::tada: https://xiongamao.github.io/vue-easy-lightbox/
MIT License
420 stars 69 forks source link

Trap/disable focus #132

Open ijkml opened 1 year ago

ijkml commented 1 year ago

Hi :wave: Is there currently a way to disable/trap focus within the lightbox? Tabbing when the lightbox is open (even with scroll disabled) continues to focus on elements on the page.

XiongAmao commented 1 year ago

Hi, When I first implemented <vue-easy-lightbox />, I used <div> as button, so ... it couldn't be focused when tabbing. I will implement this feature later.

ijkml commented 1 year ago

Thank you.

Even if you use divs, you could tab to other focusable elements on the page.

My current workaround is adding a keystroke event listener for "Tab" and event.preventDefault when visible === true.