New source found from dndbeyond.com

This commit is contained in:
2026-07-08 01:00:09 -07:00
parent 9a983a6d7b
commit dcefa0d2f2
2865 changed files with 222467 additions and 49053 deletions
+13 -4
View File
@@ -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");