This commit is contained in:
Jeffrey Chen 2024-12-23 07:24:09 +08:00
parent 179933c0d8
commit 823f0b7976

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.getAttribute("data-index");
const previousIndex = titleElement.previousElementSibling ? titleElement.previousElementSibling.getAttribute("data-index") : null;
const index = titleElement.nextElementSibling.getAttribute("data-index");
if (previousIndex) {