Closed chocolatkey closed 4 years ago
I've reproduced the issue in a simplified form in this flems
The first item in the list, with the value 0 cannot be selected (once unselected) because it is "false". I've think I've narrowed down the issue to these lines: https://github.com/vrimar/construct-ui/blob/master/src/components/query-list/index.ts#L396 https://github.com/vrimar/construct-ui/blob/master/src/components/query-list/index.ts#L451 where the selected item is first checked to be true. 0 is not true in JS, so the onSelect is never called.
0
onSelect
If this is by design, then I can work around it by having all items' number values be +1, but if not, then I think this is a bug, because there are use cases where an item's value could be something that is considered "false".
Fixed in v0.2.3.
I've reproduced the issue in a simplified form in this flems
The first item in the list, with the value
0
cannot be selected (once unselected) because it is "false". I've think I've narrowed down the issue to these lines: https://github.com/vrimar/construct-ui/blob/master/src/components/query-list/index.ts#L396 https://github.com/vrimar/construct-ui/blob/master/src/components/query-list/index.ts#L451 where the selected item is first checked to be true.0
is not true in JS, so theonSelect
is never called.If this is by design, then I can work around it by having all items' number values be +1, but if not, then I think this is a bug, because there are use cases where an item's value could be something that is considered "false".