Skip to content
Snippets Groups Projects
Commit a3445b50 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #786394 by casey: improve overlay keydown handler (TAB-navigation).

parent e4dd8802
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -613,7 +613,7 @@ Drupal.overlay.eventhandlerRestrictKeyboardNavigation = function (event) { ...@@ -613,7 +613,7 @@ Drupal.overlay.eventhandlerRestrictKeyboardNavigation = function (event) {
// move the focus along until it is. // move the focus along until it is.
var direction = event.shiftKey ? -1 : 1; var direction = event.shiftKey ? -1 : 1;
var current = this.$tabbables.index(event.target); var current = this.$tabbables.index(event.target);
var $allowedParent = $('#overlay-container, .overlay-displace-top, .overlay-displace-bottom'); var $allowedParent = '#overlay-container, .overlay-displace-top, .overlay-displace-bottom';
if (current != -1 && this.$tabbables[current + direction] && !this.$tabbables.eq(current + direction).closest($allowedParent).length) { if (current != -1 && this.$tabbables[current + direction] && !this.$tabbables.eq(current + direction).closest($allowedParent).length) {
while (this.$tabbables[current + direction] && !this.$tabbables.eq(current + direction).closest($allowedParent).length) { while (this.$tabbables[current + direction] && !this.$tabbables.eq(current + direction).closest($allowedParent).length) {
current = current + direction; current = current + direction;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment