FilterItem: value
prop
#1505
Labels
dev
Indicates that the issue or pull request involves engineering considerations
value
prop
#1505
Support or Feedback
Context
Shoreline's component
FilterItem
receives avalue
and achildren
prop (it works like the<select>
/<option>
HTML tags).The
children
text is presented at each of theFilter
popover options. But after an option is "selected" then "applied", thevalue
prop is what is actually shown by theFilter
button (in the following image, look at theRoles: 123
text):Suggestion
My suggestion is to change this behavior, to show the
children
prop text instead:This would make the
<Filter>
/<FilterOption>
behavior work more like HTML's<select>
/<option>
tags, making thechildren
prop related to the visuals and thevalue
prop related to React's controlled state. This would allow us to useID
strings in thevalue
prop without harming UI visuals - and without constantly convertingID
s<=>string
s within controlled filters.Additional Suggestion
If the previous suggestion is accepted, I would also suggest accepting the type
number
in thevalue
prop, so there's no need for constant conversion from/to numericID
s (id.toString()
/Number.parseInt(value, 10)
).``The text was updated successfully, but these errors were encountered: