fix: 🐛 Fix emoji categories having an incorrect max-height on initial load

This commit is contained in:
Jesse Wierzbinski 2024-11-19 11:14:10 +01:00
parent 7663767141
commit 626828ffa4
No known key found for this signature in database

View file

@ -32,9 +32,7 @@ defineProps<{
const collapsed = ref(false);
const container = ref<HTMLDivElement | null>(null);
watch(
collapsed,
(value) => {
watch(collapsed, (value) => {
// Use requestAnimationFrame to prevent layout thrashing
requestAnimationFrame(() => {
if (!container.value) {
@ -44,7 +42,5 @@ watch(
? "0px"
: `${container.value.scrollHeight}px`;
});
},
{ immediate: true },
);
});
</script>