Skip to content

Commit

Permalink
accordion: remove unnecessary state
Browse files Browse the repository at this point in the history
  • Loading branch information
anatolzak committed Apr 16, 2024
1 parent 491bde5 commit 98bde97
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/bits-ui/src/lib/bits/accordion/accordion.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,8 @@ type AccordionContentStateProps = BoxedValues<{

class AccordionContentState {
item = undefined as unknown as AccordionItemState;
originalStyles = $state<{ transitionDuration: string; animationName: string } | undefined>(
undefined
);
isMountAnimationPrevented = $state(false);
originalStyles: { transitionDuration: string; animationName: string } | undefined = undefined;
isMountAnimationPrevented = false;
width = boxedState(0);
height = boxedState(0);
presentEl = boxedState<HTMLElement | undefined>(undefined);
Expand Down Expand Up @@ -312,7 +310,7 @@ class AccordionContentState {
this.width.value = rect.width;

// unblock any animations/transitions that were originally set if not the initial render
if (!untrack(() => this.isMountAnimationPrevented)) {
if (!this.isMountAnimationPrevented) {
const { animationName, transitionDuration } = this.originalStyles;
node.style.transitionDuration = transitionDuration;
node.style.animationName = animationName;
Expand Down

0 comments on commit 98bde97

Please sign in to comment.