File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,9 @@ export function remove(current) {
14
14
if ( is_array ( current ) ) {
15
15
for ( var i = 0 ; i < current . length ; i ++ ) {
16
16
var node = current [ i ] ;
17
- if ( node . isConnected ) {
18
- node . remove ( ) ;
19
- }
17
+ node . remove ( ) ;
20
18
}
21
- } else if ( current . isConnected ) {
19
+ } else {
22
20
current . remove ( ) ;
23
21
}
24
22
}
Original file line number Diff line number Diff line change @@ -246,12 +246,12 @@ export function destroy_effect(effect) {
246
246
247
247
effect . teardown ?. call ( null ) ;
248
248
249
- if ( effect . dom !== null ) {
249
+ var parent = effect . parent ;
250
+
251
+ if ( effect . dom !== null && ( parent === null || ( parent . f & DESTROYED ) === 0 ) ) {
250
252
remove ( effect . dom ) ;
251
253
}
252
254
253
- var parent = effect . parent ;
254
-
255
255
// If the parent doesn't have any children, then skip this work altogether
256
256
if ( parent !== null && ( effect . f & BRANCH_EFFECT ) !== 0 && parent . first !== null ) {
257
257
var previous = effect . prev ;
You can’t perform that action at this time.
0 commit comments