extend select2 (#699)
This commit is contained in:
@@ -219,7 +219,10 @@ function isElementVisible(element) {
|
|||||||
)
|
)
|
||||||
return element.parentElement && isElementVisible(element.parentElement);
|
return element.parentElement && isElementVisible(element.parentElement);
|
||||||
|
|
||||||
if (element.className.toString().includes("select2-offscreen")) {
|
if (
|
||||||
|
element.className.toString().includes("select2-offscreen") ||
|
||||||
|
element.className.toString().includes("select2-hidden")
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,10 +471,21 @@ const isComboboxDropdown = (element) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isSelect2Dropdown = (element) => {
|
const isSelect2Dropdown = (element) => {
|
||||||
return (
|
const tagName = element.tagName.toLowerCase();
|
||||||
element.tagName.toLowerCase() === "a" &&
|
const className = element.className.toString();
|
||||||
element.className.toString().includes("select2-choice")
|
const role = element.getAttribute("role")
|
||||||
);
|
? element.getAttribute("role").toLowerCase()
|
||||||
|
: "";
|
||||||
|
|
||||||
|
if (tagName === "a") {
|
||||||
|
return className.includes("select2-choice");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tagName === "span") {
|
||||||
|
return className.includes("select2-selection") && role === "combobox";
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isSelect2MultiChoice = (element) => {
|
const isSelect2MultiChoice = (element) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user