Select with required
attribute incorrectly reports missing value until value change occurs
#2416
Labels
bug
Something isn't working
🐛 Bug Report
Form validation on a select with
required
incorrectly reports a missing value until a value change has occurred. I.e. the initial value is not seen.💁 Possible Solution
This happens because we try to mirror the initial value to the proxy native
select
element (within a call tosuper.slottedOptionsChanged()
) before we have mirrored the child option elements. The nativeselect
will reject/ignore settingvalue
if it doesn't correspond to the value of one of its child options (of which it has none, at that point). Right after mirroring the child options, there is a call toupdateValue()
, but because the value has already been updated earlier, it short-circuits, skipping the code path that would have updated the proxy.The text was updated successfully, but these errors were encountered: