File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ describe('attribute fallthrough', () => {
330330 expect ( `Extraneous non-emits event listeners` ) . toHaveBeenWarned ( )
331331 } )
332332
333- it . todo ( 'should warn when fallthrough fails on teleport root node' , ( ) => {
333+ it ( 'should warn when fallthrough fails on teleport root node' , ( ) => {
334334 const Parent = {
335335 render ( ) {
336336 return createComponent ( Child , { class : ( ) => 'parent' } )
@@ -340,7 +340,6 @@ describe('attribute fallthrough', () => {
340340 const root = document . createElement ( 'div' )
341341 const Child = defineVaporComponent ( {
342342 render ( ) {
343- // return h(Teleport, { to: root }, h('div'))
344343 return createComponent (
345344 VaporTeleport ,
346345 { to : ( ) => root } ,
@@ -352,7 +351,6 @@ describe('attribute fallthrough', () => {
352351 } )
353352
354353 document . body . appendChild ( root )
355- // render(h(Parent), root)
356354 define ( Parent ) . render ( )
357355
358356 expect ( `Extraneous non-props attributes (class)` ) . toHaveBeenWarned ( )
Original file line number Diff line number Diff line change @@ -130,14 +130,16 @@ export class TeleportFragment extends VaporFragment {
130130 private handleChildrenUpdate ( children : Block ) : void {
131131 // not mounted yet
132132 if ( ! this . parent || isHydrating ) {
133- this . nodes = children
133+ // Teleport nodes are always an array, preventing attrs fallthrough
134+ // consistent with VDOM Teleport behavior.
135+ this . nodes = [ children ]
134136 return
135137 }
136138
137139 // teardown previous nodes
138140 remove ( this . nodes , this . mountContainer ! )
139141 // mount new nodes
140- insert ( ( this . nodes = children ) , this . mountContainer ! , this . mountAnchor ! )
142+ insert ( ( this . nodes = [ children ] ) , this . mountContainer ! , this . mountAnchor ! )
141143 }
142144
143145 private handlePropsUpdate ( ) : void {
You can’t perform that action at this time.
0 commit comments