Skip to content

Dialog: Fix IE tests about interactions with other dialogs #2160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions ui/widgets/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down