Hi!
I have a new problem with sp-picker
With this code, when I change the language (it gets from state thorugh react redux), the selected item doesn’t change the translation. If I open the picker all sp-menu-items are translated (also the selected), but with the picker closed the selected doesn’t change.
const customSizeUnits = [
{ unit: 'in', translation: translations[selectedLanguage].UNITS_INCHES },
{ unit: 'cm', translation: translations[selectedLanguage].UNITS_CENTIMETERS },
{ unit: 'mm', translation: translations[selectedLanguage].UNITS_MILLIMETERS },
{ unit: 'pt', translation: translations[selectedLanguage].UNITS_POINTS }
];
const [selectedCustomSizeUnit, setSelectedCustomSizeUnit] = useState(1);
<sp-picker label="Label" size="s">
<sp-menu slot="options">
{customSizeUnits.map((customSizeUnit, customSizeUnitIndex) => (
<sp-menu-item key={customSizeUnitIndex} selected={customSizeUnitIndex == selectedCustomSizeUnit ? true : null}>
{customSizeUnit.translation}
</sp-menu-item>
))}
</sp-menu>
</sp-picker>