Closed empresarrollo closed 6 years ago
I tried various solution but none of worked. I gone through packages like https://github.com/theKashey/vue-focus-lock but their solution is not clean and a bit hacky. I have also gone through bootstrap model component, because it is already doing the same. But could not figure out how they are doing.
At least when the loader is fullscreen (I don't use it yet for a component), it should be possible by creating a method
onKeyDown(event) {
if (event.keyCode == 9) {
event.preventDefault()
}
}
and then on the created() method add something like document.addEventListener('keydown', this.onKeyDown)
I'll try this tomorrow, when I'm back to the project that is using this component.
I am constantly reading about this
https://hiddedevries.nl/en/blog/2017-01-29-using-javascript-to-trap-focus-in-an-element https://css-tricks.com/a-css-approach-to-trap-focus-inside-of-an-element/
Trying to find best and cheap way
@empresarrollo I have made this feature, i haven't released it, need more testing. See the commit https://github.com/ankurk91/vue-loading-overlay/commit/063cceee1d4800ea986b2e845fdb85263cff2d29
Will invest more time this weekend.
Released v2.2.0
It would be great if you can capture the tab key so the user cannot go to some inputs or links with the tab key while the loading is enabled