sdpi-components
sdpi-components copied to clipboard
fix: error when `checkbox-list` receives invalid data
Hi There, I came across an error when switching from the <sdpi-select> component to <sdpi-checkbox-list>. Becasue the data persisted in the setting was a string and not an array, I was getting an error along the lines of
TypeError: 'findIndex' does not exist on 'this.value'
Although I can't see this ever affecting end-users at runtime, I think it would be beneficial to prevent this issue by first checking if the data is an Array by using Array.isArray(). There is already a fallback in place for when this condition fails.