Repository navigation
Emit the resolved breakpoint from <FormRender>, for keying a teleported Teleport - #13
Merged
Merged
Conversation
…ed Teleport A breakpoint switch can move a teleportAnchor() cell to a different row or column, which makes Vue discard the old <div :id> and create a new one rather than patch it in place. A <Teleport :to> only re-resolves its target when the to string itself changes, so it keeps pointing at the removed element and the teleported content renders empty even though the id it names is unchanged and present elsewhere in the DOM. <FormRender> now emits breakpoint with the currently resolved breakpoint, once immediately and on every change. Keying a consumer's <Teleport> on it forces a remount, which re-resolves the target against the current anchor. Patch release, v0.7.7.
✅ Incremental coverage — 100%
10 files not graded (3 ignored by pattern, 7 not source files)
Coverage reports: coverage/coverage-final.json (istanbul, 16 files) — incremental-coverage-check v3.0.0 |
defineEmits<T>() requires T to satisfy Record<string, any[]> at Vue's declared peer floor (3.5.2). TypeScript only infers that structurally for a type literal, never for an interface even when shaped identically, so the floor job failed with FormRenderEmits declared as an interface.
…oken below it Keying a <Teleport defer> on the new breakpoint emit remounts it - an update, not a fresh mount - and [email protected] through 3.5.31 crash inside patchBlockChildren when that happens before the deferred mount runs (fixed by vuejs/core#14642, released in 3.5.32). The floor test file reproduced the crash directly: a keyed Teleport around a moving teleportAnchor() cell threw TypeError: Cannot read properties of null (reading 'parentNode') from inside Vue's own patch/unmount path. teleportAnchor()'s useId() workaround for [email protected] - stripping the colon its counter used to separate with, and the string | undefined return type that version declared - is dead at the new floor: 3.5.32 already returns a plain string with a hyphen.
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.
Summary
teleportAnchor()cell to a different row/column, so Vue discards the old<div :id>and creates a new one instead of patching it in place; a<Teleport :to>only re-resolves its target when thetostring itself changes, so it keeps pointing at the removed element and the teleported content renders empty.<FormRender>now emitsbreakpointwith the currently resolved breakpoint (once immediately, then on every change), so a consumer can key their own<Teleport>on it to force a remount and re-resolve against the current anchor.readme.md,docs/api/form-render.md,docs/examples/form-builder.md) and the liveform-basic.vueexample are updated to show the pattern; the previous claim that a sharedidRefalone "keeps it anchored... instead of orphaning it the moment the breakpoint changes" is corrected.Test plan
npx vitest run- all 249 tests pass, including a new regression pair that reproduces the orphaning bug unkeyed and confirms the fix keyednpm run lint(eslint + vue-tsc) - cleannpm run build&&npm run verify:artifact- cleannpm run docs:build- clean