New source found from dndbeyond.com
This commit is contained in:
+13
-4
@@ -16,7 +16,17 @@ exports.default = findTabbableDescendants;
|
||||
* http://api.jqueryui.com/category/ui-core/
|
||||
*/
|
||||
|
||||
var tabbableNode = /input|select|textarea|button|object/;
|
||||
var DISPLAY_NONE = "none";
|
||||
var DISPLAY_CONTENTS = "contents";
|
||||
|
||||
// match the whole word to prevent fuzzy searching
|
||||
var tabbableNode = /^(input|select|textarea|button|object|iframe)$/;
|
||||
|
||||
function isNotOverflowing(element, style) {
|
||||
return style.getPropertyValue("overflow") !== "visible" ||
|
||||
// if 'overflow: visible' set, check if there is actually any overflow
|
||||
element.scrollWidth <= 0 && element.scrollHeight <= 0;
|
||||
}
|
||||
|
||||
function hidesContents(element) {
|
||||
var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
|
||||
@@ -27,9 +37,8 @@ function hidesContents(element) {
|
||||
try {
|
||||
// Otherwise we need to check some styles
|
||||
var style = window.getComputedStyle(element);
|
||||
return zeroSize ? style.getPropertyValue("overflow") !== "visible" ||
|
||||
// if 'overflow: visible' set, check if there is actually any overflow
|
||||
element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue("display") == "none";
|
||||
var displayValue = style.getPropertyValue("display");
|
||||
return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;
|
||||
} catch (exception) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("Failed to inspect element style");
|
||||
|
||||
Reference in New Issue
Block a user