emulate-tab icon indicating copy to clipboard operation
emulate-tab copied to clipboard

Make visibleBySize optional

Open nick-keller opened this issue 2 years ago • 2 comments

Hello, great work on this package!

My issue

The browser (at least Chrome, haven't tested other browsers) does not skip 0 pixels high tabbable elements. But emulate-tab has a check isVisibleBySize which checks the height of candidates elements. This results in skipping elements, not mimicking the browser's behavior.

Why do I care about 0 height elements?

I use them to "catch" focus at given places on my page, having two of them (one before, one after my component) allows me to know if the focus comes from the top or the bottom.

Proposed solution

Make it an option checkVisibilityBySize: boolean = true. (default value would be true for backward compatibility) Ideally we could pass the option when calling emulateTab, but a global option would work as well I guess.

nick-keller avatar Aug 31 '21 07:08 nick-keller