diff --git a/.changeset/fuzzy-countries-jam.md b/.changeset/fuzzy-countries-jam.md new file mode 100644 index 00000000000..ba631ec0d77 --- /dev/null +++ b/.changeset/fuzzy-countries-jam.md @@ -0,0 +1,5 @@ +--- +"@siemens/ix": patch +--- + +fix(core/select): set value before triggering event diff --git a/packages/core/src/components/select/select.tsx b/packages/core/src/components/select/select.tsx index d54779a43a3..c0071847930 100644 --- a/packages/core/src/components/select/select.tsx +++ b/packages/core/src/components/select/select.tsx @@ -254,14 +254,16 @@ export class Select { } private itemClick(newId: string) { + const oldValue = this.value; const value = this.toggleValue(newId); + this.value = value; const defaultPrevented = this.emitValueChange(value); if (defaultPrevented) { + this.value = oldValue; return; } - this.value = value; this.updateSelection(); }