Selecting the first option (which has value "") should send a message updating the selected value to "". Instead it sends a message with the content of the selected option.
Analysis
The value property of <option></option> is "", while the value of <option>foo</option> is "foo". Since we applyFactsbefore appending children, we decide not to add the value property.
So I see 2 reasonable strategies to make this more robust:
switch the order. The impact of doing that is rather unclear.
change the special casing of value in applyFacts: the current condition does not cover the case where appending children changes the value property.
Current workaround
Using [ Html.Attribute.attribute "value" "", value "" ] sets the actual valueattribute on the node, which makes this behave.
Thanks to @bdukes on Slack for surfacing the issue!
SSCCE
https://ellie-app.com/937PLf6rLa1/0
Expected behaviour
Selecting the first option (which has
value ""
) should send a message updating the selected value to""
. Instead it sends a message with the content of the selected option.Analysis
The
value
property of<option></option>
is""
, while thevalue
of<option>foo</option>
is"foo"
. Since weapplyFacts
before appending children, we decide not to add thevalue
property.So I see 2 reasonable strategies to make this more robust:
value
inapplyFacts
: the current condition does not cover the case where appending children changes thevalue
property.Current workaround
Using
[ Html.Attribute.attribute "value" "", value "" ]
sets the actualvalue
attribute on the node, which makes this behave.Thanks to @bdukes on Slack for surfacing the issue!