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 doesn't get the data on the first click on dropdown item #1377

Closed
2 tasks done
AnnaGrahl opened this issue Jul 9, 2024 · 4 comments · Fixed by #1401
Closed
2 tasks done

ix select doesn't get the data on the first click on dropdown item #1377

AnnaGrahl opened this issue Jul 9, 2024 · 4 comments · Fixed by #1401
Labels
type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed

Comments

@AnnaGrahl
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?

We wanted to update to the latest ix version. We faced some issues regarding the ix select.
We noticed this with our cypress tests which failed after the update.

After the update, we need to select two times the item in the dropdown menu. On the first click the value is undefined. Also in the code example i provided you, you notice, that the value is selected, after two clicks, the first is the value before.
image

image

image

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

Angular

Which version of iX do you use?

v2.4.0

Code to produce this issue.

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

@Component({
  selector: 'app-example',
  template: `
    <ix-select
    (itemSelectionChange)="onGatewaySelectionChange($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 Select {
  value = '1';

  onGatewaySelectionChange(event: Event): void {
    const select = event.target as HTMLSelectElement;
    console.log('Selected gateway:', select.value);
  }
}
@AnnaGrahl AnnaGrahl added the triage We discuss this topic in our internal weekly label Jul 9, 2024
@danielleroux
Copy link
Collaborator

@AnnaGrahl You can workaround this issue by using the event detail:

  onGatewaySelectionChange(event: Event): void {
    const select = event as CustomEvent;
    console.log('Selected gateway:', select.detail);
  }

@danielleroux danielleroux added type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed and removed triage We discuss this topic in our internal weekly labels Jul 9, 2024
Copy link
Contributor

github-actions bot commented Jul 9, 2024

🤖 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-1448

@m7mdyahia
Copy link

was this solved in 2.4.1?

@Domi1980
Copy link

@m7mdyahia Doesn't seem to be the case. I mistakenly merged 2.4.1 into our codebase and observed the same issue.
But the workaround posted by @danielleroux seems to fix it for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants