euvl / vue-js-modal

Easy to use, highly customizable Vue.js modal library.
http://vue-js-modal.yev.io
MIT License
4.35k stars 592 forks source link

Fix SHIFT + TAB issue on last element in focusTrap #780

Closed JaZo closed 1 year ago

JaZo commented 1 year ago

This will prevent a jump from the last to the first element when you press SHIFT + TAB on the last element, which isn't the first element.

Issue

Given you have three focusable elements: A, B, C.

Order on TAB (correct)

A > B > C > A > B > C > etc.

Order on SHIFT + TAB (incorrect)

A > C > A > C > A > etc.