英文:
mat-select panel still shows overlapped like version 14 and below even after upgrade to angular material 15
问题
我们在项目中使用了 mat-select,但面板显示在触发文本上,就像版本 14 及之前的版本一样(我们的项目中使用的是 material 版本 12)。
在寻找了一些小技巧后,面板显示在触发文本下方,但在不同屏幕大小下不一致,特别是在移动视图中。
我们发现从 material 版本 15 开始,选择面板会显示在触发文本下方。
因此,我们升级到 material 版本 15,同时升级了 Angular 版本到 15。但是即使升级后,mat-select 仍然以之前的样式显示。
有人能否提供一些建议,指出可能出了什么问题,以及如何使 mat-select 的工作方式与 material 版本 15 的 mat-select 相同。
英文:
we have used mat-select in our project, the panel shows overlapping on the trigger text like version 14 and before (material version 12 was used in our project)
after finding few hacks, the panel showed below the trigger text, but it was not consistent with different screen sizes, specially the mobile view.
We found that from material version 15, the select panel showed below the trigger text -
so we upgraded to material version 15, and also upgraded the angular version to 15. But even after the upgrade the mat-select is still showing in the previous style.
Can someone please suggest what could be going wrong here and what needs to be done to get working like material version 15 mat-select
答案1
得分: 0
根据评论,您只更新到了 Angular Material 15,但仍在使用传统模式运行。
要完全迁移,您需要运行以下命令:
schematic: ng generate @angular/material:mdc-migration
但是,由于类名更改为 mdc 前缀等以及一些组件的结构更改,您应该遵循它们的迁移指南。
https://rc.material.angular.io/guide/mdc-migration
英文:
Based on the comments, you have only updated to Angular material 15, but is running in legacy mode.
To fully migrate you need to run.
schematic: ng generate @angular/material:mdc-migration
however due to class name changes to the mdc- prefix etc and structual changes in some of the componets. you should follow their migration guide.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论