If the selected item has an item value that is null then it is not shown
Issue: If items contain an item value that is null and that is the selected item, it is not being shown on load as the selected item.
Expected Behavior: If an item exists with the itemValueField as null it should be shown as selected if that is the form control/models value.
Reproduction: 2 ports exist: Tokai with id null and Vladivostok with id false. the boolean works fine, but setting the currently selected port as null does not show "Tokai".
https://stackblitz.com/edit/ionic-selectable-initial-value-dhwpws?file=pages/home/home.ts
What version of ionic-selectable are you using?
4.9 on my local env.
Hi, actually null is not considered a value, therefore is not appropriate for use in ids
Thanks! Would this be a reasonable feature request? If not we should add it to the docs.
thanks for you contribution, let me evaluate if is reasonable add this condition for ids
or you can submit a PR and we will evaluate the convenience to integrate it, thanks
Sure! Can you point me to the area of the code that handles values to get me started?
You can check the setValue method, here https://github.com/ionic-selectable/ionic-selectable/blob/1d149bf14d8cb0a991eb360dd2be622e2e6af254/packages/core/src/components/ionic-selectable/ionic-selectable.component.tsx#L1296
Thanks! Will see if I can get a PR out shortly.