Open mkyral opened 1 year ago
It is caused by Autocomplete. When I enter screen first time, there is a delay caused by downloading data from server. But when I enter screen for second time, data are already downloaded and it crashes on undefined getElement function.
Note: I'm using {#key} to force Autocomplete element refresh on list change.
{#key suppliersListUpdated}
<Autocomplete
options="{() => {return [...suppliersList]}}"
bind:value={supplierFilter}
deleteBtnEnabled={true}
getOptionLabel="{(option) => option ? `${option.supplierNo} - ${option.supplierName}` : ''}"
label="{$_('supplier')}"
textfield$class="white small"
textfield$variant="outlined"
/>
{/key}
After some investigation I've updated the key calculation to ensure that Array is defined and is not empty and it fixed the issue. But I still have no idea what exactly was wrong.
Is this still an issue in the latest version?
Describe the bug In some cases, returning to previously loaded page, I'm getting following crash:
Probably introduced by commit 73fe3dfcbd26089e77765bf83196217958a206c5 It's curious that in previous commit d617f9727ab23fdf7662659e2332534d8009ee26 was added check to ensure that element is not null. But this check was not included in move into onMount() function.