File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
packages/svelte/src/compiler/phases/3-transform/client/visitors/shared Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -154,13 +154,19 @@ function is_static_element(node, state) {
154154 return false ;
155155 }
156156
157- if ( attribute . value !== true && ! is_text_attribute ( attribute ) ) {
158- // if it's not a text attribute but it's an inlinable expression
159- // we will inline it in the template so we can still consider it static
160- return is_inlinable_expression (
157+ if (
158+ attribute . value !== true &&
159+ ! is_text_attribute ( attribute ) &&
160+ // if the attribute is not a text attribute but is inlinable we will directly inline it in the
161+ // the template so if it's not inlinable we can return false but if it is inlinable (or a text)
162+ // attribute we keep count of the inlinable attributes so that if all the attributes are inlinable
163+ // we deem the node as static
164+ ! is_inlinable_expression (
161165 Array . isArray ( attribute . value ) ? attribute . value : [ attribute . value ] ,
162166 state
163- ) ;
167+ )
168+ ) {
169+ return false ;
164170 }
165171 }
166172
You can’t perform that action at this time.
0 commit comments