summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/jquery.tabbable.shim.js
diff options
context:
space:
mode:
authorcatch <catch@35733.no-reply.drupal.org>2022-09-09 07:26:42 +0100
committercatch <catch@35733.no-reply.drupal.org>2022-09-09 07:26:42 +0100
commit8aa8ce1ffbcca9c727f46e58c714e1d351f7ef88 (patch)
tree27be6908992c340ba0b4c0bd3f4339670aa71e90 /core/misc/jquery.tabbable.shim.js
parent09f8f13d8a72b8e482cc689fcd10f023df41b899 (diff)
downloaddrupal-8aa8ce1ffbcca9c727f46e58c714e1d351f7ef88.tar.gz
drupal-8aa8ce1ffbcca9c727f46e58c714e1d351f7ef88.zip
Issue #3278415 by nod_, lauriii, catch, Wim Leers, longwave, xjm, claudiu.cristea: Remove usages of the JavaScript ES6 build step, the build step itself, and associated dev dependencies
Diffstat (limited to 'core/misc/jquery.tabbable.shim.js')
-rw-r--r--core/misc/jquery.tabbable.shim.js28
1 files changed, 13 insertions, 15 deletions
diff --git a/core/misc/jquery.tabbable.shim.js b/core/misc/jquery.tabbable.shim.js
index bd4174214c2e..6820cd1b1ff7 100644
--- a/core/misc/jquery.tabbable.shim.js
+++ b/core/misc/jquery.tabbable.shim.js
@@ -1,30 +1,28 @@
/**
-* DO NOT EDIT THIS FILE.
-* See the following change record for more information,
-* https://www.drupal.org/node/2815083
-* @preserve
-**/
+ * @file
+ * Defines a backwards-compatible shim for the jQuery UI :tabbable selector.
+ */
-(($, Drupal, _ref) => {
- let {
- isTabbable
- } = _ref;
+(($, Drupal, { isTabbable }) => {
$.extend($.expr[':'], {
tabbable(element) {
Drupal.deprecationError({
- message: 'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 11.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730'
+ message:
+ 'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 11.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730',
});
+ // The tabbable library considers the summary element tabbable, and also
+ // considers a details element without a summary tabbable. The jQuery UI
+ // :tabbable selector does not. This is due to those element types being
+ // inert in IE/Edge.
+ // @see https://allyjs.io/data-tables/focusable.html
if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') {
const tabIndex = element.getAttribute('tabIndex');
-
if (tabIndex === null || tabIndex < 0) {
return false;
}
}
-
return isTabbable(element);
- }
-
+ },
});
-})(jQuery, Drupal, window.tabbable); \ No newline at end of file
+})(jQuery, Drupal, window.tabbable);