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