Skip to content

Commit

Permalink
fix: 🐛 Fix emoji categories having an incorrect max-height on initial…
Browse files Browse the repository at this point in the history
… load
  • Loading branch information
CPlusPatch committed Nov 19, 2024
1 parent 7663767 commit 626828f
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions components/settings/emojis/category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,15 @@ defineProps<{
const collapsed = ref(false);
const container = ref<HTMLDivElement | null>(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`;
});
});
</script>

0 comments on commit 626828f

Please sign in to comment.