diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 0d77970c0..d2de82320 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -291,11 +291,9 @@ ${unicode2Emoji(emoji.unicode)}`; } this.element.scrollTop = 0; let currentHintElement = this.element.querySelector(".b3-list-item--focus") as HTMLElement; - if (isAbnormalItem(currentHintElement, "b3-list-item")) { + while (isAbnormalItem(currentHintElement, "b3-list-item")) { currentHintElement.classList.remove("b3-list-item--focus"); - do { - currentHintElement = currentHintElement.nextElementSibling as HTMLElement; - } while (isAbnormalItem(currentHintElement, "b3-list-item")); + currentHintElement = currentHintElement.nextElementSibling as HTMLElement; currentHintElement?.classList.add("b3-list-item--focus"); } this.bindUploadEvent(protyle, this.element);