aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-05-10 10:55:40 +0200
committerGitHub <noreply@github.com>2023-05-10 10:55:40 +0200
commit7adb13ac7c30a7ba33f1db256952be77b9e7a310 (patch)
tree2f7750f1a8f27c5c9f06b5403757d7dc675b893b
parent020828e7ffd5e7830d979b4c5cf8412f04223973 (diff)
downloadjquery-ui-7adb13ac7c30a7ba33f1db256952be77b9e7a310.tar.gz
jquery-ui-7adb13ac7c30a7ba33f1db256952be77b9e7a310.zip
Dialog: Fix IE tests about interactions with other dialogs
The workaround triggering a second delayed focus to a tabbable element was applied in jQueries 3.4 & 3.5 to fix IE issues. It also needs to be applied in jQuery 3.6 which this commit adds. This will no longer be needed in jQuery 3.7 and jQuery 3.x-git tests are already passing because of that. Closes gh-2160
-rw-r--r--ui/widgets/dialog.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js
index 4dcb93a8d..0ff816ec6 100644
--- a/ui/widgets/dialog.js
+++ b/ui/widgets/dialog.js
@@ -881,12 +881,15 @@ $.widget( "ui.dialog", {
event.preventDefault();
instance._focusTabbable();
- // Support: jQuery >=3.4 <3.6 only
- // Focus re-triggering in jQuery 3.4/3.5 makes the original element
- // have its focus event propagated last, breaking the re-targeting.
- // Trigger focus in a delay in addition if needed to avoid the issue
+ // Support: jQuery >=3.4 <3.7 only
+ // In jQuery 3.4-3.6, there are multiple issues with focus/blur
+ // trigger chains or when triggering is done on a hidden element
+ // at least once.
+ // Trigger focus in a delay in addition if needed to avoid the issues.
// See https://github.com/jquery/jquery/issues/4382
- if ( jqMinor === "3.4." || jqMinor === "3.5." ) {
+ // See https://github.com/jquery/jquery/issues/4856
+ // See https://github.com/jquery/jquery/issues/4950
+ if ( jqMinor === "3.4." || jqMinor === "3.5." || jqMinor === "3.6." ) {
instance._delay( instance._restoreTabbableFocus );
}
}