Closed rishwanthrajaa closed 1 year ago
Please go through the issue, actual issue is - After selecting an option from drop down, selected value is not showing up. Kindly respond as comment and request not to close it immediately.
As mentioned the previous time this issue was opened, this isn't enough information to debug the issue. Can you post what your code looks like?
HTML Code
TS Code @Component({ selector: 'select-form-example', templateUrl: 'select-form-example.html', }) export class SelectFormExample { selectedValue: string; selectedCar: string;
foods: Food[] = [ {value: 'steak-0', viewValue: 'Steak'}, {value: 'pizza-1', viewValue: 'Pizza'}, {value: 'tacos-2', viewValue: 'Tacos'}, ];
cars: Car[] = [ {value: 'volvo', viewValue: 'Volvo'}, {value: 'saab', viewValue: 'Saab'}, {value: 'mercedes', viewValue: 'Mercedes'}, ]; }
The above is the code, but after selecting an option, selected value is not shown in mat-select field
This is the exact code in the project, but selected value is not displaying in the field, it worked fine in anglular materal v10 and angular core v10, but same code is not working in when both material and angular version is v15
This is likely an issue somewhere else in your app. The snippet from above works for me. See https://stackblitz.com/edit/6sjsie?file=src%2Fapp%2Fselect-custom-trigger-example.ts,src%2Fapp%2Fselect-custom-trigger-example.html,src%2Fapp%2Fapp.module.ts
Yeah, we tried the same snippet in other application/compliers, its working for me. But in the project's application is not working as expected still, not sure why.
Okay, can you please let me know, as per angular's standard, its good to keep Angular v15 and Material v12 in production environment? If yes, we can go with this, we did not face any issue on the drop down. Kindly let me know on this version compatibility.
In general we recommend that Material and Core are on the same major version (so both 15) or you might run into weird build issues.
As of now, there is no build or compilation error while deployment, anyway after a year angular version will be updated. So can we keep v12 and angular v15, then later can we address the compatibility issue?
Until material v12 all are fine, we have the drop down issue from v13, that's why not sure how to proceed on this. We have used reactive forms to create formcontrols and ngModel for data binding, will that be a problem after material v12?
It's at your own risk if you want to stay on the mismatched versions. The internals of mat-select
haven't changed significantly in a couple of years.
I understand, since the application was built in v10 initially, after v15 Angular Material 15 styles for legacy components has showed up right. Will there any issue due to those legacy theme or something?
In your image you have a dot in [(ngModel).] , maybe thats the reason? haha
Its only in image, in application its not, we can ignore it. Due to CSS or material theming, will it cause the issue? And in similar way for mat-select, is there any issue reported to Angular?
I'm closing the issue since this is likely a problem somewhere else in your app. Better avenues for troubleshooting / questions are stack overflow, gitter, mailing list, etc.
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.
Is this a regression?
The previous version in which this bug was not present was
Angular V10.1.5 and Material V10.2.4
Description
This report is regarding dropdown field issue of Angular Material V15.2.4 (Mat-Select)
Recently, we have upgraded our project's angular version from v10.1.5 to v15.2.4. Application's drop down fields were working fine in angular v10.1.5 and material v10.2.4. But when the version got upgraded with angular v15.2.4 and material v15.2.4., all the drop down fields are facing issue in showing the selected option.
Issue:
Support Needed
Kindly respond whether it is a good standard to have Angular v15.2.4 and material v12.2.13 as part of production release or provide an fix for the issue in the upgraded versions for both angular and material v15.2.4.
Below one is the actual issue
Reproduction
Steps to reproduce:
Expected Behavior
The expected behavior is - After selecting any one of the option, mat-select has to show up the selected option.
Expected working one as mentioned in this example - https://material.angular.io/components/select/examples#select-form
Actual Behavior
Actual behavior - After selecting an option, selected value does not show up in the Mat-Select Field.
Below one the case where the field is empty after selecting an option. This is the broken drop down issue
Environment