fix(vdomInterop): handling template ref on vdom child with insertion state#14243
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where template refs were not properly set on vdom children when using insertion state (e.g., when the child is wrapped in a parent element). The fix ensures that when setRef is called on an already-mounted vdom component, the ref is properly established.
- Adds a call to
vdomSetRefin thesetRefmethod when the component is already mounted - Includes a comprehensive test case to verify the fix works with vdom children and insertion state
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runtime-vapor/src/vdomInterop.ts | Added ref setting logic for already-mounted vdom components in the setRef method |
| packages/runtime-vapor/tests/dom/templateRef.spec.ts | Added test case to verify template refs work correctly with vdom children when using insertion state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
close #14242