aboutsummaryrefslogtreecommitdiff
path: root/js/src/dom/selector-engine.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-08-18 07:29:56 +0300
committerGitHub <[email protected]>2021-08-18 07:29:56 +0300
commit433a148c9e61aa942801fd8101dfa5c4045fdaed (patch)
treef41db59fd06019169df5ea0338213ec0e298f226 /js/src/dom/selector-engine.js
parentb97cfa163b5098db70e03b27c91fca5dde9c267e (diff)
parent18b3e1ac71f73d006756684a285c5a818e2d1454 (diff)
downloadbootstrap-global-focus-vars.tar.xz
bootstrap-global-focus-vars.zip
Merge branch 'main' into global-focus-varsglobal-focus-vars
Diffstat (limited to 'js/src/dom/selector-engine.js')
-rw-r--r--js/src/dom/selector-engine.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/js/src/dom/selector-engine.js b/js/src/dom/selector-engine.js
index b310098b5..e3988a986 100644
--- a/js/src/dom/selector-engine.js
+++ b/js/src/dom/selector-engine.js
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.0.0-beta2): dom/selector-engine.js
+ * Bootstrap (v5.1.0): dom/selector-engine.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -11,6 +11,8 @@
* ------------------------------------------------------------------------
*/
+import { isDisabled, isVisible } from '../util/index'
+
const NODE_TEXT = 3
const SelectorEngine = {
@@ -69,6 +71,21 @@ const SelectorEngine = {
}
return []
+ },
+
+ focusableChildren(element) {
+ const focusables = [
+ 'a',
+ 'button',
+ 'input',
+ 'textarea',
+ 'select',
+ 'details',
+ '[tabindex]',
+ '[contenteditable="true"]'
+ ].map(selector => `${selector}:not([tabindex^="-"])`).join(', ')
+
+ return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))
}
}