Closed OG84 closed 1 week ago
ok so it seems like the same bug is present with selectedIndizes. But due to the fact that I'm supplying a new array instance on each render, in my example it looks like it's working. Without wrapping the selectedIndizes in a new array each time, the same problem occurs.
Closes via #1548.
Prerequisites
What happened?
When using
<IxSelect>
with dynamically populated nested<IxSelectItem>
's, the initial value (usingvalue
prop) is not selected correctly.When using the deprecated
selectedIndices
prop, the initial value is shown correctly.This must have something to do with the change detection when IxSelectItems are changed dynamically after the parent IxSelect has been rendered.
This bug only occurs for dynamic IxSelectItems. For static hard coded values it is working fine.
Please see my stackblitz.
Edit: Seems like when setting the
value
prop AFTER the items have been initialized it is working. (e.g. setSelectedValue('2') inside the callback, see example code)What type of frontend framework are you seeing the problem on?
React
Which version of iX do you use?
v2.5.0
Code to produce this issue.