Skip to content

Emit the resolved breakpoint from <FormRender>, for keying a teleported Teleport - #13

Merged
velis74 merged 3 commits into
mainfrom
fix/teleport-anchor-breakpoint-switch
Aug 25, 2026
Merged

velis74 merged 3 commits into
mainfrom
fix/teleport-anchor-breakpoint-switch

Conversation

@velis74

@velis74 velis74 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • A breakpoint switch can move a 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 the to string itself changes, so it keeps pointing at the removed element and the teleported content renders empty.
  • <FormRender> now emits breakpoint with 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.
  • Docs (readme.md, docs/api/form-render.md, docs/examples/form-builder.md) and the live form-basic.vue example are updated to show the pattern; the previous claim that a shared idRef alone "keeps it anchored... instead of orphaning it the moment the breakpoint changes" is corrected.
  • Patch release, v0.7.7.

Test plan

  • npx vitest run - all 249 tests pass, including a new regression pair that reproduces the orphaning bug unkeyed and confirms the fix keyed
  • npm run lint (eslint + vue-tsc) - clean
  • npm run build && npm run verify:artifact - clean
  • npm run docs:build - clean

…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.
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

✅ Incremental coverage — 100%

████████████████████ 5 / 5 changed lines covered · threshold 70% · main → fix/teleport-anchor-breakpoint-switch

File Coverage Covered Uncovered lines
✅ src/core/form-layout/component/component.ts 100% 1 / 1 —
✅ src/layout/form-render.vue 100% 4 / 4 —
Total 100% 5 / 5
10 files not graded (3 ignored by pattern, 7 not source files)
File Reason
changelog.md not a source file
docs/api/form-render.md not a source file
docs/components/form-basic.vue ignored by docs/**
docs/examples/form-builder.md not a source file
docs/guide/getting-started.md not a source file
package-lock.json not a source file
package.json not a source file
readme.md not a source file
src/layout/form-render.spec.ts ignored by *.spec.*
src/layout/types.ts ignored by src/layout/types.ts

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.
@velis74
velis74 merged commit bcd1b16 into main Aug 25, 2026
6 checks passed
@velis74
velis74 deleted the fix/teleport-anchor-breakpoint-switch branch August 25, 2026 10:24
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.

1 participant