Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IX Select input clears if selection options change (since version 2.6.1) #1716

Open
2 tasks done
vormacher opened this issue Feb 27, 2025 · 3 comments
Open
2 tasks done
Labels
Contribution welcome 👨‍💻 This issue is open for contributions from the community type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed

Comments

@vormacher
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

What happened?

Hi,

Use Case:
We're using the iX-select to search and select data in a database.
Every time the iX-select input changes, an API is being called to retrieve new data.

Problem:
Since the Version 2.6.1 the input is getting cleared if a new value (select-option) is being added.

In the "How to Produce", you will also find our current workaround by adding an additional div-container around the selects.

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

React

Which version of iX do you use?

2.6.1

Code to produce this issue.

// stackblitz: https://stackblitz.com/edit/react-ts-qcylb8l8?file=App.tsx
import * as React from 'react';
import './style.css';
import { IxSelect, IxSelectItem } from '@siemens/ix-react';

export default function App() {
  const [items, setItems] = React.useState<string[]>([]);

  const callApiWhichAddNewSelectOptions = (event: any) => {
    setTimeout(() => {
      setItems((prevItems) => [...prevItems, event.detail]);
    }, 1000);
  };

  return (
    <>
      <h3>broken select:</h3>
      <IxSelect
        value="1"
        onInputChange={callApiWhichAddNewSelectOptions}
        i18nPlaceholder="Search in database..."
      >
        {items.map((i, index) => (
          <IxSelectItem key={index} label={i} value={i}></IxSelectItem>
        ))}
      </IxSelect>
      <br />
      <br />
      <h3>working select (with additional container):</h3>
      <IxSelect
        value="1"
        onInputChange={callApiWhichAddNewSelectOptions}
        i18nPlaceholder="Search in database..."
      >
        <div>
          {items.map((i, index) => (
            <IxSelectItem key={index} label={i} value={i}></IxSelectItem>
          ))}
        </div>
      </IxSelect>
    </>
  );
}
@vormacher vormacher added the triage We discuss this topic in our internal weekly label Feb 27, 2025
@vormacher vormacher changed the title IX Select clears input if available selection options change (since version 2.6.1) IX Select input clears if selection options change (since version 2.6.1) Feb 27, 2025
@danielleroux
Copy link
Collaborator

Could be introduced by #1574 or #1595, just to mention for further investigation.

@matthiashader matthiashader added type: bug Something isn't working Contribution welcome 👨‍💻 This issue is open for contributions from the community labels Mar 3, 2025
Copy link
Contributor

github-actions bot commented Mar 3, 2025

The issue has been labeled as Contribution welcome 👨‍💻. This issue is open for contributions from the community.

If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.
Thank you!

@matthiashader matthiashader added Workflow: Issue created JIRA issue is created and will be analyzed and removed triage We discuss this topic in our internal weekly labels Mar 10, 2025
Copy link
Contributor

github-actions bot commented Mar 10, 2025

🤖 Hello @vormacher

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-2449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution welcome 👨‍💻 This issue is open for contributions from the community type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed
Projects
None yet
Development

No branches or pull requests

3 participants