Skip to content

Commit 7adb13a

Browse files
authored
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 jquerygh-2160
1 parent 020828e commit 7adb13a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ui/widgets/dialog.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -881,12 +881,15 @@ $.widget( "ui.dialog", {
881881
event.preventDefault();
882882
instance._focusTabbable();
883883

884-
// Support: jQuery >=3.4 <3.6 only
885-
// Focus re-triggering in jQuery 3.4/3.5 makes the original element
886-
// have its focus event propagated last, breaking the re-targeting.
887-
// Trigger focus in a delay in addition if needed to avoid the issue
884+
// Support: jQuery >=3.4 <3.7 only
885+
// In jQuery 3.4-3.6, there are multiple issues with focus/blur
886+
// trigger chains or when triggering is done on a hidden element
887+
// at least once.
888+
// Trigger focus in a delay in addition if needed to avoid the issues.
888889
// See https://github.com/jquery/jquery/issues/4382
889-
if ( jqMinor === "3.4." || jqMinor === "3.5." ) {
890+
// See https://github.com/jquery/jquery/issues/4856
891+
// See https://github.com/jquery/jquery/issues/4950
892+
if ( jqMinor === "3.4." || jqMinor === "3.5." || jqMinor === "3.6." ) {
890893
instance._delay( instance._restoreTabbableFocus );
891894
}
892895
}

0 commit comments

Comments
 (0)