diff --git a/components/settings/emojis/category.vue b/components/settings/emojis/category.vue index dd7b0df..ec9c8ae 100644 --- a/components/settings/emojis/category.vue +++ b/components/settings/emojis/category.vue @@ -32,19 +32,15 @@ defineProps<{ const collapsed = ref(false); const container = ref(null); -watch( - collapsed, - (value) => { - // Use requestAnimationFrame to prevent layout thrashing - requestAnimationFrame(() => { - if (!container.value) { - return; - } - container.value.style.maxHeight = value - ? "0px" - : `${container.value.scrollHeight}px`; - }); - }, - { immediate: true }, -); +watch(collapsed, (value) => { + // Use requestAnimationFrame to prevent layout thrashing + requestAnimationFrame(() => { + if (!container.value) { + return; + } + container.value.style.maxHeight = value + ? "0px" + : `${container.value.scrollHeight}px`; + }); +}); \ No newline at end of file