-
Notifications
You must be signed in to change notification settings - Fork 359
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
VUFIND-1667: Fix tabbing within a modal dialog #3642
Conversation
themes/bootstrap3/js/lightbox.js
Outdated
var focEls = _modal.find(":tabbable"); | ||
var lastEl = $(focEls[focEls.length-1]); | ||
$(lastEl).off('keydown.bs.modal'); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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).
Thanks, @maccabeelevine! I'll now look forward to hearing from @crhallberg and/or @EreMaijala when their time permits. |
themes/bootstrap3/js/lightbox.js
Outdated
// 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'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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
.