Skip to content

Add BasicListItem.iconSelected property and use it in CheckableListItem

Right now CheckableListItem overrides the background and text color so that only the checkbox of the list item changes appearance when list items are selected and deselected.

However it forgot to force the list item's icon (if any) to an unselected state. As a result, when a list item with a monochrome icon is checked, its item enters a selected state, inverts its color, and disappears. Poof!

This is because it's currently not possible to override the selection state of the icon like you can currently do with the background and text. So icons always have a dynamic appearance even for list items with otherwise hardcoded colors, which is a problem.

The issue is remedied by adding an alias property iconSelected to BasicListitem that is an alias to the icon's current selection state. This property is read/write so it can be used to force the icon to always be "unselected", which CheckableListItem can then use to do just that and fix the bug.

Before After
Before After

Merge request reports