fix(bindable): Fix bindable initial value precedence in Vue/Svelte#3218
Merged
Conversation
🦋 Changeset detectedLatest commit: ba1efdf The changes in this PR will be included in the next version bump. This PR includes changesets to release 86 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes # chakra-ui/ark#3942
📝 Description
In
@ark-ui/vueDrawer, the first open after page mount does not play the CSS open animation. Computed style onDrawer.Contentshowsanimation: none(inlineanimation: none !important). Closing works normally; opening a second time plays the open animation as expected.Root Cause
1. Vue
bindabledropsdefaultValue: nullIn
@zag-js/vue:In Drawer machine context:
Because
??treatsnullas missing:So on mount,
context.get("dragOffset")isundefined, notnull.Compare React / Solid (works correctly):
BTW,
Svelteuses the samedefaultValue ?? valuepattern asVue2. Drawer treats non-
nullas “dragging”In
@zag-js/drawerconnect:So immediately after mount (drawer still closed):
api.dragging === truedata-dragging/data-swipingtransition-duration: 0sis applied3. First
openentry suppresses CSS animationopenstate entry includesdeferClearDragOffset:Intent: after swipe-to-open, temporarily disable CSS animations so they do not fight transform-driven settle.
Bug: first click-to-open also hits this path because
dragOffsetisundefined, so open CSS animations are killed with!important.4. Why the second open works
rafeventually runscontext.set("dragOffset", null)clearSwipeOpenAnimation, whichremoveProperty("animation")null→deferClearDragOffsetearly-returns → CSS open animation runs💣 Is this a breaking change (Yes/No): No
Addition
Since this default value binding issue has only surfaced in the
Drawercomponent so far, I'm not yet certain whether it could affect other components as well. Fixing it as soon as possible will help align the behavior of theVueandSvelteimplementations withReact.P.S. Special thanks to
Cursor Grok 4.5model for helping quickly pinpoint this subtle issue.