Skip to content

Commit

Permalink
Fixes Accessibility issue: improve pop-up control focusing (#1133)
Browse files Browse the repository at this point in the history
- Fixes #1071.
  • Loading branch information
LlGC-jop authored Oct 17, 2024
1 parent 9bb923a commit 88178e3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ export class Dialogue<
if ($defaultButton.length) {
$defaultButton.focus();
} else {
// if there's no default button, focus on the first visible input
const $input: JQuery = this.$element.find("input:visible").first();
// if there's no default button, focus on the first visible input or select element
const $firstVisibleElement: JQuery = this.$element.find("input:visible, select:visible").first();

if ($input.length) {
$input.focus();
if ($firstVisibleElement.length) {
$firstVisibleElement.focus();
} else {
// if there's no visible first input, focus on the close button
this.$closeButton.focus();
Expand Down

0 comments on commit 88178e3

Please sign in to comment.