Unable to set combobox's initial value
prop
#9590
Labels
0 - new
New issues that need assignment.
ArcGIS Field Apps
Issues logged by ArcGIS Field Apps team members.
bug
Bug reports for broken functionality. Issues should include a reproduction of the bug.
calcite-components
Issues specific to the @esri/calcite-components package.
estimate - 5
A few days of work, definitely requires updates to tests.
impact - p2 - want for an upcoming milestone
User set priority impact status of p2 - want for an upcoming milestone
p - medium
Issue is non core or affecting less that 60% of people using the library
Milestone
Check existing issues
Actual Behavior
When rendering a
<calcite-combobox value="…">
with a definedvalue
, the corresponding<calcite-combobox-item>
element is not initially selected.Expected Behavior
At minimum, if
value
is initially defined, I'm expecting the<calcite-combobox-item>
child with the samevalue
to be initiallyselected
.For other cases, the suggested expected behavior is to match how the
<calcite-select>
element behaves:value
is initially defined but a non-corresponding<calcite-combobox-item>
child is marked asselected
, thevalue
prop wins and theselected
prop is moved to the corresponding child.value
does not match any child values,value
is reset to an empty string and no child is selected.value
does not match any child values and a child is marked asselected
,value
is reset to an empty string and theselected
prop is removed from the child.value
is an empty string, no child is automatically selected.value
is an empty string and a child is marked asselected
, theselected
prop is removed from the child.Reproduction Sample
https://developers.arcgis.com/calcite-design-system/components/combobox/
Reproduction Steps
value
prop (e.g. to "Agriculture") and see the matching item does not become selected.Reproduction Version
2.9.0
Relevant Info
Setting the
value
prop programmatically after the component is loaded does behave as expected.Regression?
No response
Priority impact
impact - p2 - want for an upcoming milestone
Impact
A workaround is to set the child's initial
selected
prop instead.Calcite package
Esri team
ArcGIS Field Apps
The text was updated successfully, but these errors were encountered: