Skip to content
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

VUFIND-1667: Fix tabbing within a modal dialog #3642

Merged
merged 3 commits into from
May 22, 2024

Conversation

maccabeelevine
Copy link
Member

@maccabeelevine maccabeelevine commented May 7, 2024

For https://openlibraryfoundation.atlassian.net/browse/VUFIND-1667

Disable the "Modal Extension" event listener in bootstrap-accessibility(.min).js. Lightbox.js does the same idea better in retainFocus.

@maccabeelevine maccabeelevine marked this pull request as ready for review May 7, 2024 17:54
Comment on lines 530 to 532
var focEls = _modal.find(":tabbable");
var lastEl = $(focEls[focEls.length-1]);
$(lastEl).off('keydown.bs.modal');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ugly variable names are just echoing what's in bootstrap-accessibility, for easier reference.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like one small thing is needed to make continuous integration happy.

Beyond that, I defer to @crhallberg and @EreMaijala for overall approval of this. (Makes sense to me, but want to be sure we do it in a way that can be most easily removed as part of the bootstrap5 migration).

themes/bootstrap3/js/lightbox.js Outdated Show resolved Hide resolved
@demiankatz demiankatz added this to the 10.0 milestone May 7, 2024
@demiankatz
Copy link
Member

Thanks, @maccabeelevine! I'll now look forward to hearing from @crhallberg and/or @EreMaijala when their time permits.

// This is moot once that library (and bootstrap3) are retired.
var focEls = _modal.find(":tabbable");
var lastEl = $(focEls[focEls.length - 1]);
$(lastEl).off('keydown.bs.modal');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well sussed! I notice that it applied to the first element as well. Might as well take care of both, right?

https://github.com/paypal/bootstrap-accessibility-plugin/blob/main/src/js/modal.js#L16

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I made that change, I don't think there is any impact but I agree it's better to remove both listeners since we really want to fully replace the original function.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. I'll wait for confirmation from @crhallberg before the final merge.

@demiankatz demiankatz removed the request for review from crhallberg May 22, 2024 15:58
@demiankatz demiankatz merged commit bd0f644 into vufind-org:dev May 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants