File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
packages/svelte/src/compiler/phases/2-analyze/css Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -895,7 +895,7 @@ function get_possible_element_siblings(element, adjacent_only) {
895895 let i = path . length ;
896896
897897 while ( i -- ) {
898- let current = node ;
898+ let fragment = /** @type { Compiler.AST.Fragment } */ ( path [ i -- ] ) ;
899899
900900 // @ts -expect-error
901901 while ( ( node = node . prev ) ) {
@@ -928,20 +928,14 @@ function get_possible_element_siblings(element, adjacent_only) {
928928 }
929929 }
930930
931- let parent = path [ i ] ;
931+ node = path [ i ] ;
932932
933- if ( parent . type === 'Fragment' ) {
934- parent = path [ -- i ] ;
935- }
936-
937- if ( ! parent || ! is_block ( parent ) ) break ;
933+ if ( ! node || ! is_block ( node ) ) break ;
938934
939- if ( parent . type === 'EachBlock' && ! parent . fallback ?. nodes . includes ( current ) ) {
935+ if ( node . type === 'EachBlock' && fragment === node . body ) {
940936 // `{#each ...}<a /><b />{/each}` — `<b>` can be previous sibling of `<a />`
941- add_to_map ( get_possible_last_child ( parent , adjacent_only ) , result ) ;
937+ add_to_map ( get_possible_last_child ( node , adjacent_only ) , result ) ;
942938 }
943-
944- node = parent ;
945939 }
946940
947941 return result ;
You can’t perform that action at this time.
0 commit comments