Commit db58bb5f authored by rdavis's avatar rdavis
Browse files

refactor: Removed dependency

parent d5c0876a
<script lang="ts">
import { afterUpdate } from 'svelte';
export let open = false;
export let className = '';
// Manage the max-height of the collapsible content for snappy transitions
let contentElement: HTMLElement;
let maxHeight = '0px'; // Initial max-height
// After any state update, adjust the max-height for the transition
afterUpdate(() => {
$: if (contentElement?.scrollHeight) {
if (open) {
// Ensure the element is visible before measuring
maxHeight = `${contentElement.scrollHeight}px`;
} else {
maxHeight = '0px';
}
});
}
</script>
<div class={className}>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment