File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,11 +248,16 @@ export class WidgetForm extends LitElement {
248248 }
249249
250250 renderDropdown ( field : Column , i : number ) {
251+ // Bind the value on the select itself (not just `selected` on the option):
252+ // md-outlined-select only reports its `value` to the form via ElementInternals,
253+ // and the declarative `selected` attribute does not reliably sync into it — so
254+ // a prefilled option would display but submit empty.
251255 return html `
252256 < label class ="label ">
253257 ${ field . label }
254258 < md-outlined-select
255259 name ="column- ${ i } "
260+ .value =${ field . preFilledValue ?? field . defaultValue ?? '' }
256261 supporting-text =${ field . description ?? '' }
257262 ?required=${ field . required && ! field . defaultValue && ! field . preFilledValue }
258263 >
@@ -261,10 +266,7 @@ export class WidgetForm extends LitElement {
261266 ( val ) => val . value ,
262267 ( val ) => {
263268 return html `
264- < md-select-option
265- .value ="${ val . value ?? '' } "
266- ?selected ="${ val . value === ( field . preFilledValue ?? field . defaultValue ) } "
267- >
269+ < md-select-option .value ="${ val . value ?? '' } ">
268270 ${ val . displayLabel }
269271 </ md-select-option >
270272 `
You can’t perform that action at this time.
0 commit comments