MDL-67149 Accessibility: Help popups fail WCAG 1.4.13 (Dismissable)
It must be possible to dismiss the help popups (popovers) with the Escape key, without changing focus.
This commit is contained in:
Vendored
+1
-1
@@ -1 +1 @@
|
||||
define(["jquery","./tether","core/event"],function(a,b,c){return window.jQuery=a,window.Tether=b,M.util.js_pending("theme_boost/loader:children"),require(["theme_boost/aria","theme_boost/pending","theme_boost/util","theme_boost/alert","theme_boost/button","theme_boost/carousel","theme_boost/collapse","theme_boost/dropdown","theme_boost/modal","theme_boost/scrollspy","theme_boost/tab","theme_boost/tooltip","theme_boost/popover"],function(b){a("body").popover({trigger:"focus",selector:"[data-toggle=popover][data-trigger!=hover]"}),a("html").popover({container:"body",selector:"[data-toggle=popover][data-trigger=hover]",trigger:"hover",delay:{hide:500}}),c.getLegacyEvents().done(function(b){a(document).on(b.FILTER_CONTENT_UPDATED,function(){a("body").popover({selector:'[data-toggle="popover"]',trigger:"focus"})})}),b.init(),M.util.js_complete("theme_boost/loader:children")}),{}});
|
||||
define(["jquery","./tether","core/event","core/custom_interaction_events"],function(a,b,c,d){return window.jQuery=a,window.Tether=b,M.util.js_pending("theme_boost/loader:children"),require(["theme_boost/aria","theme_boost/pending","theme_boost/util","theme_boost/alert","theme_boost/button","theme_boost/carousel","theme_boost/collapse","theme_boost/dropdown","theme_boost/modal","theme_boost/scrollspy","theme_boost/tab","theme_boost/tooltip","theme_boost/popover"],function(b){a("body").popover({trigger:"focus",selector:"[data-toggle=popover][data-trigger!=hover]"}),d.define(a("body"),[d.events.escape]),a("body").on(d.events.escape,"[data-toggle=popover]",function(){a(this).popover("hide")}),a("html").popover({container:"body",selector:"[data-toggle=popover][data-trigger=hover]",trigger:"hover",delay:{hide:500}}),c.getLegacyEvents().done(function(b){a(document).on(b.FILTER_CONTENT_UPDATED,function(){a("body").popover({selector:'[data-toggle="popover"]',trigger:"focus"})})}),b.init(),M.util.js_complete("theme_boost/loader:children")}),{}});
|
||||
@@ -23,7 +23,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @since 2.9
|
||||
*/
|
||||
define(['jquery', './tether', 'core/event'], function(jQuery, Tether, Event) {
|
||||
define(['jquery', './tether', 'core/event', 'core/custom_interaction_events'], function(jQuery, Tether, Event, customEvents) {
|
||||
|
||||
window.jQuery = jQuery;
|
||||
window.Tether = Tether;
|
||||
@@ -50,6 +50,14 @@ define(['jquery', './tether', 'core/event'], function(jQuery, Tether, Event) {
|
||||
selector: "[data-toggle=popover][data-trigger!=hover]"
|
||||
});
|
||||
|
||||
// Popovers must close on Escape for accessibility reasons.
|
||||
customEvents.define(jQuery('body'), [
|
||||
customEvents.events.escape,
|
||||
]);
|
||||
jQuery('body').on(customEvents.events.escape, '[data-toggle=popover]', function() {
|
||||
jQuery(this).popover('hide');
|
||||
});
|
||||
|
||||
jQuery("html").popover({
|
||||
container: "body",
|
||||
selector: "[data-toggle=popover][data-trigger=hover]",
|
||||
|
||||
Reference in New Issue
Block a user