Skip to content

fix(text-morph): reset dimensions on zero-size early return in transitionContainerSize#44

Open
loicnico96 wants to merge 1 commit intolochie:mainfrom
loicnico96:fix/text-morph-zero-dimension-freeze
Open

fix(text-morph): reset dimensions on zero-size early return in transitionContainerSize#44
loicnico96 wants to merge 1 commit intolochie:mainfrom
loicnico96:fix/text-morph-zero-dimension-freeze

Conversation

@loicnico96
Copy link
Copy Markdown

Unfortunate timing may cause transitionContainerSize to be called with 0 oldWidth/oldHeight while 0px width/height css are being applied - hitting the early-return guard and permanently leaving the css at 0px (as that does not get reset anywhere else). This PR resets to 'auto' before returning so the container reverts to natural content sizing.

Fixes #43

…tionContainerSize

When text is cleared and a new character is typed before the fade animation
completes, element.offsetWidth returns 0 (the CSS target), triggering the
early-return guard. Previously this left inline width/height pinned at 0px
permanently. Now we reset to 'auto' before returning so the container reverts
to natural content sizing.

Fixes lochie#43
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

@loicnico96 is attempting to deploy a commit to the Lochie Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timing issue when typing after clearing sometimes causes container to be stuck with broken styles

1 participant