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

Bug in autoComplete #18286

Closed
rezarouzbahani opened this issue Jan 25, 2020 · 3 comments
Closed

Bug in autoComplete #18286

rezarouzbahani opened this issue Jan 25, 2020 · 3 comments
Labels
area: material/autocomplete needs: clarification The issue does not contain enough information for the team to determine if it is a real bug

Comments

@rezarouzbahani
Copy link

Bug

What is the expected behavior?

[viewValue]="option.Name" [value]="option.Id"

What is the current behavior?

[viewValue]="option.Name" [value]="option.Name"

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

What is the use-case or motivation for changing an existing behavior?

<mat-form-field class="example-full-width">
  <input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="myControl"
    [matAutocomplete]="auto">
  <mat-autocomplete #auto="matAutocomplete" (optionSelected)="optionSelected($event)">
    <mat-option *ngFor="let option of diseasesObservable | async" [viewValue]="option.Name" [value]="option.Id">
      {{option.Name}}
    </mat-option>
  </mat-autocomplete>
</mat-form-field>

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

lateast

Is there anything else we should know?

I expect [viewValue]="option.Name" filled in TextBox and [Value]="option.Id" doesn't Fill in TextBox
and in optionSelected($event) have ViewValue (Title for example) and have Value (1 for example )
Notice : [Value]="option.Id" bind to TextBox in html
Thanks

@crisbeto
Copy link
Member

crisbeto commented Feb 1, 2020

I'm not sure I follow what the issue is here. Also mat-option doesn't have a viewValue input.

@crisbeto crisbeto added the needs: clarification The issue does not contain enough information for the team to determine if it is a real bug label Feb 1, 2020
@wagnermaciel
Copy link
Contributor

Closing because this issue has been inactive for 2 weeks or more after follow up was requested.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/autocomplete needs: clarification The issue does not contain enough information for the team to determine if it is a real bug
Projects
None yet
Development

No branches or pull requests

4 participants