This commit is contained in:
Jeffrey Chen 2024-12-24 16:35:22 +08:00
parent 246d4d04f5
commit 681a8363a2

View file

@ -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) {