fix id selector (#573)

This commit is contained in:
LawyZheng
2024-07-10 14:55:59 +08:00
committed by GitHub
parent 2d9e74bffe
commit da66d66132
2 changed files with 5 additions and 5 deletions

View File

@@ -630,14 +630,14 @@ async function getSelect2OptionElements(element) {
while (true) {
oldOptionCount = optionList.length;
let newOptionList = document.querySelectorAll(
"#select2-drop li[role='option']",
"[id='select2-drop'] li[role='option']",
);
if (newOptionList.length === oldOptionCount) {
console.log("no more options loaded, wait 5s to query again");
// sometimes need more time to load the options, so sleep 10s and try again
await sleep(5000); // wait 5s
newOptionList = document.querySelectorAll(
"#select2-drop li[role='option']",
"[id='select2-drop'] li[role='option']",
);
console.log(newOptionList.length, " options found, after 5s");
}