File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
packages/svelte/src/compiler/compile/render_dom/wrappers/Element Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' svelte ' : patch
3
+ ---
4
+
5
+ fix: apply transition to ` <svelte:element> ` with local transition
Original file line number Diff line number Diff line change @@ -233,6 +233,14 @@ export default class ElementWrapper extends Wrapper {
233
233
strip_whitespace ,
234
234
next_sibling
235
235
) ;
236
+
237
+ // in the case of `parent_block -> child_dynamic_element_block -> child_dynamic_element`
238
+ // `child_dynamic_element_block.add_intro/outro` is called inside `new ElementWrapper()`
239
+ // but when `is_local === true` it does not bubble to parent_block
240
+ // we manually add transitions back to the parent_block (#8233)
241
+ if ( node . intro ) block . add_intro ( node . intro . is_local ) ;
242
+ if ( node . outro ) block . add_outro ( node . outro . is_local ) ;
243
+
236
244
// the original svelte:element is never used for rendering, because
237
245
// it gets assigned a child_dynamic_element which is used in all rendering logic.
238
246
// so doing all of this on the original svelte:element will just cause double
@@ -266,10 +274,10 @@ export default class ElementWrapper extends Wrapper {
266
274
this . event_handlers = this . node . handlers . map (
267
275
( event_handler ) => new EventHandler ( event_handler , this )
268
276
) ;
269
- if ( node . intro || node . outro ) {
270
- if ( node . intro ) block . add_intro ( node . intro . is_local ) ;
271
- if ( node . outro ) block . add_outro ( node . outro . is_local ) ;
272
- }
277
+
278
+ if ( node . intro ) block . add_intro ( node . intro . is_local ) ;
279
+ if ( node . outro ) block . add_outro ( node . outro . is_local ) ;
280
+
273
281
if ( node . animation ) {
274
282
block . add_animation ( ) ;
275
283
}
You can’t perform that action at this time.
0 commit comments