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

Auto select the dropdown value on change event from another component #1445

Closed
2 tasks done
vamshisai98 opened this issue Aug 30, 2024 · 2 comments
Closed
2 tasks done
Labels
triage We discuss this topic in our internal weekly wait for response Wait for author response

Comments

@vamshisai98
Copy link

vamshisai98 commented Aug 30, 2024

Prerequisites

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

What happened?

I want to update my ix-select value without selecting it by click, but would want it automatically selected once the ix-select data is poplulated based on API service call.
Although from the image in ix-select dropdown you can see the value is being highlighted. But the label is not updating.
auto-select

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

Angular

Which version of iX do you use?

v2.4.1

Code to produce this issue.

<ix-category-filter id="category-filter-search__ix-category-filter" [placeholder]="placeholder"
      [repeatCategories]="repeatCategories" [categories]="categories" [filterState]="filterState"
      (categoryChanged)="handleCategoryChange($event)" (filterChanged)="handleFilterChange($event)"
      (inputChanged)="handleInputChange($event)"></ix-category-filter>
  </div>
  <ix-select id="category-filter-search__ix-select" [value]="selectValue" [disabled]="disableDropDown"
    (valueChange)="handleValueChange($event)">
    <ix-select-item (itemClick)="handleSelectItemClick($event)" id="category-filter-search__ix-select-item" *ngFor="let item of categoryItems" [label]="item.label"
      [value]="item.value"></ix-select-item>
  </ix-select>






//.ts file
 this.value = ''
 this.categoryItems:any = [{'label':'',value:''}]
      filterChange(){
      this.value= this.categoryItems[0].value;
      this.valueChange(this.value)
      }
      
        valueChange(event: { detail: string }) {
    console.log(event, 'SEL')
    this.selectValue = event.detail;
@vamshisai98 vamshisai98 added the triage We discuss this topic in our internal weekly label Aug 30, 2024
@matthiashader
Copy link
Collaborator

Hi @vamshisai98, thanks for reaching out - could you provide a working stackblitz examples? I have tried recreating it, but it seems to work without any problems: https://stackblitz.com/edit/qn9vg7?file=src%2Fapp%2Fselect.ts

@matthiashader matthiashader added the wait for response Wait for author response label Aug 30, 2024
@matthiashader
Copy link
Collaborator

Hello @vamshisai98 ! Tested in latest version, should be fixed - if this issue still occurs, just open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage We discuss this topic in our internal weekly wait for response Wait for author response
Projects
None yet
Development

No branches or pull requests

2 participants