siemens / ix

Siemens Industrial Experience is a design system for designers and developers, to consistently create the perfect digital experience for industrial software products.
https://ix.siemens.io/
MIT License
203 stars 69 forks source link

<IxSelect> itemSelectionChange is triggered two times after adding item #1424

Closed AnnaGrahl closed 6 days ago

AnnaGrahl commented 3 months ago

Prerequisites

What happened?

The event itemSelectionChange is triggered two times after adding an item to an editable select. The second time it is triggered, the value is an object and not the value string. image

What type of frontend framework are you seeing the problem on?

Angular

Which version of iX do you use?

v2.4

Code to produce this issue.

https://stackblitz.com/edit/k4whud?file=src%2Fapp%2Fselect-editable.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-example',
  template: `
    <ix-select 
    editable [value]="value"
    (itemSelectionChange)="OnSelectionChange($event)"
    >
      <ix-select-item label="Item 1" value="1"></ix-select-item>
      <ix-select-item label="Item 2" value="2"></ix-select-item>
      <ix-select-item label="Item 3" value="3"></ix-select-item>
      <ix-select-item label="Item 4" value="4"></ix-select-item>
    </ix-select>
  `,
})
export default class SelectEditable {
  value = '1';

  OnSelectionChange(event: Event) {
    const value = (event as CustomEvent)?.detail;
    console.log(value);
  }
}
github-actions[bot] commented 2 months ago

🤖 Hello @AnnaGrahl

Your issue will be analyzed and is part of our internal workflow. To get informed about our workflow please checkout the Contributing Guidelines

JIRA: IX-1624

matthiashader commented 6 days ago

Hello @AnnaGrahl - this issue is resolved in the latest version (2.5.0), if this issue persists don't hesitate to open a new ticket! (https://stackblitz.com/edit/owvupc?file=src%2Fselect-editable.ts)