Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
404 views
in Technique[技术] by (71.8m points)

angular - Mat Date Picker overflows when opened

In my Angular project I use mat date picker in multiple places. Recently I started see this issue(not sure what caused it), mat date picker overflows when opened. I see this issue across the application not just at one place. Not sure how to describe it, attaching the screen shot for reference. I couldn't reproduce this in StackBlitz as this is specific to my application. I am using Angular and Material 11.1.2

Update: After digging further, I figured out mat-calendar-table class is actually crossing the boundaries and causes overflow

Mat Date Picker Issue

question from:https://stackoverflow.com/questions/66049716/mat-date-picker-overflows-when-opened

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Based on this issue adding table-layout: fixed; to table tag in styles.scss file fixed my issues

table
{
  table-layout: fixed !important;
  width: 100% !important; 
}

If you also use mat-table and you don't want mat-table layout to be fixed, add the following css to styles.scss

table
{
  table-layout: fixed !important;
  width: 100% !important;
}

.mat-table
{
  table-layout: auto !important;
  width: 100% !important;
}



与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...