diff --git a/src/compiler/compile/css/Selector.ts b/src/compiler/compile/css/Selector.ts index c141f6b481..46e9b4c4f0 100644 --- a/src/compiler/compile/css/Selector.ts +++ b/src/compiler/compile/css/Selector.ts @@ -406,7 +406,7 @@ function get_possible_element_siblings(node: INode, adjacent_only: boolean): Map let prev: INode = node; while (prev = prev.prev) { if (prev.type === 'Element') { - if (!prev.attributes.find(attr => attr.name.toLowerCase() === 'slot')) { + if (!prev.attributes.find(attr => attr.type === 'Attribute' && attr.name.toLowerCase() === 'slot')) { result.set(prev, NodeExist.Definitely); } diff --git a/test/css/samples/siblings-combinator-with-spread/_config.js b/test/css/samples/siblings-combinator-with-spread/_config.js new file mode 100644 index 0000000000..c81f1a9f82 --- /dev/null +++ b/test/css/samples/siblings-combinator-with-spread/_config.js @@ -0,0 +1,3 @@ +export default { + warnings: [] +}; diff --git a/test/css/samples/siblings-combinator-with-spread/expected.css b/test/css/samples/siblings-combinator-with-spread/expected.css new file mode 100644 index 0000000000..aacf6e7db5 --- /dev/null +++ b/test/css/samples/siblings-combinator-with-spread/expected.css @@ -0,0 +1 @@ +input.svelte-xyz:focus+div.svelte-xyz{color:red}input.svelte-xyz:focus~div.svelte-xyz{color:red} \ No newline at end of file diff --git a/test/css/samples/siblings-combinator-with-spread/expected.html b/test/css/samples/siblings-combinator-with-spread/expected.html new file mode 100644 index 0000000000..d732739701 --- /dev/null +++ b/test/css/samples/siblings-combinator-with-spread/expected.html @@ -0,0 +1,2 @@ + +
Should be red, when input is focused
\ No newline at end of file diff --git a/test/css/samples/siblings-combinator-with-spread/input.svelte b/test/css/samples/siblings-combinator-with-spread/input.svelte new file mode 100644 index 0000000000..fbbd124bcc --- /dev/null +++ b/test/css/samples/siblings-combinator-with-spread/input.svelte @@ -0,0 +1,11 @@ + + + + + +
Should be red, when input is focused
\ No newline at end of file