@@ -165,7 +165,7 @@ impl<'a> AstDomTransform<'a, '_> {
165165 if has_children && plan. key == "textContent" {
166166 continue ;
167167 }
168- match self . classify_plan ( & plan) {
168+ match self . classify_plan ( & plan, tag_name ) {
169169 PlanDisposition :: Skip => { }
170170 PlanDisposition :: Inline ( value) => match value {
171171 None => append_bare_attribute ( template, & plan. key , self . omit_attribute_spacing ) ,
@@ -200,7 +200,7 @@ impl<'a> AstDomTransform<'a, '_> {
200200
201201 /// Pure classification of one planned attribute, mirroring Babel's
202202 /// static-vs-expression branch in the attribute loop.
203- fn classify_plan ( & self , plan : & AttrPlan < ' a > ) -> PlanDisposition {
203+ fn classify_plan ( & self , plan : & AttrPlan < ' a > , tag_name : & str ) -> PlanDisposition {
204204 if self . hydratable && plan. key == "$ServerOnly" {
205205 return PlanDisposition :: Skip ;
206206 }
@@ -211,6 +211,7 @@ impl<'a> AstDomTransform<'a, '_> {
211211 return PlanDisposition :: Skip ;
212212 }
213213 let reserved = plan. style_property || plan. class_property || plan. key . starts_with ( "prop:" ) ;
214+ let select_value = tag_name == "select" && plan. key == "value" ;
214215 match & plan. value {
215216 PlanValue :: None => {
216217 if reserved {
@@ -222,7 +223,7 @@ impl<'a> AstDomTransform<'a, '_> {
222223 }
223224 }
224225 PlanValue :: Literal ( value) => {
225- if reserved || child_properties ( & plan. key ) {
226+ if reserved || child_properties ( & plan. key ) || select_value {
226227 PlanDisposition :: Runtime
227228 } else {
228229 PlanDisposition :: Inline ( Some ( value. clone ( ) ) )
@@ -243,14 +244,14 @@ impl<'a> AstDomTransform<'a, '_> {
243244 }
244245 }
245246 Expression :: StringLiteral ( literal) => {
246- if child_properties ( & plan. key ) {
247+ if child_properties ( & plan. key ) || select_value {
247248 PlanDisposition :: Runtime
248249 } else {
249250 PlanDisposition :: Inline ( Some ( literal. value . to_string ( ) ) )
250251 }
251252 }
252253 Expression :: NumericLiteral ( literal) => {
253- if child_properties ( & plan. key ) {
254+ if child_properties ( & plan. key ) || select_value {
254255 PlanDisposition :: Runtime
255256 } else {
256257 PlanDisposition :: Inline ( Some ( format_number ( literal. value ) ) )
@@ -586,7 +587,7 @@ impl<'a> AstDomTransform<'a, '_> {
586587 } = self . plan_attributes ( attributes, tag_name) ?;
587588 let mut pending: std:: vec:: Vec < ( String , Option < String > ) > = std:: vec:: Vec :: new ( ) ;
588589 for plan in & plans {
589- match self . classify_plan ( plan) {
590+ match self . classify_plan ( plan, tag_name ) {
590591 PlanDisposition :: Skip => { }
591592 PlanDisposition :: Inline ( value) => pending. push ( ( plan. key . clone ( ) , value) ) ,
592593 PlanDisposition :: Runtime => return Ok ( None ) ,
0 commit comments