diff --git a/app/src/emoji/index.ts b/app/src/emoji/index.ts index a2a7fb29e8c..638163899a2 100644 --- a/app/src/emoji/index.ts +++ b/app/src/emoji/index.ts @@ -523,7 +523,7 @@ export const openEmojiPanel = (id: string, type: "doc" | "notebook" | "av", posi if (target.classList.contains("emojis__type")) { const titleElement = emojisContentElement.querySelector(`[data-type="${target.getAttribute("data-type")}"]`) as HTMLElement; if (titleElement) { - const previousIndex = titleElement.previousElementSibling ? titleElement.previousElementSibling.getAttribute("data-index") : null; + const previousIndex = titleElement.previousElementSibling?.getAttribute("data-index"); const index = titleElement.nextElementSibling.getAttribute("data-index"); if (previousIndex) {