SimpleListItem's isCurrent prop not behaving as expected
See original GitHub issueDescribe the issue. What is the expected and unexpected behavior?
SimpleListItem accepts isCurrent
that is described as “Indicates if the link is current/highlighted”, allowing manual control. In practice though, isCurrent
is only the initial state and is overwritten by SimpleListItem’s internal state when something on the list is clicked.
Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.
An Item in a SimpleList’s isCurrent
prop can be hardcoded to true, making it highlighted, then click an item. It will behave as if the prop was never set and only the clicked on Item will be highlighted.
Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around? Bug, not blocking.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
@tlabaj taking this one
Yes, but using a new flag like
isUncontrolled
. Then if present,isCurrent
would be the only thing determining if an item is current.And I agree that we should update the prop name to
defaultIsCurrent
(well, technically add this prop becauseisCurrent
will still be used) and then use that for the controlled SimpleList.