angular-material-components icon indicating copy to clipboard operation
angular-material-components copied to clipboard

Angular 13 from time to time component UI is broken - no errs in the console

Open cmester opened this issue 3 years ago • 10 comments

From time to time some users are experiencing this issue (Mac or Windows - latest chrome versions, Angular 13)

image

Issue dissapears after hard refresh.

Anybody experienced a similar issue, is there a workaround?

cmester avatar Jun 02 '22 06:06 cmester

+1

kaihenzler avatar Jun 03 '22 07:06 kaihenzler

@cmester I will try to release a new version as soon as possible. Thanks to your support.

h2qutc avatar Jun 07 '22 22:06 h2qutc

Any updates as to when this issue will be resolved?

johnbu2 avatar Jul 23 '22 05:07 johnbu2

image

+1

angular 14.0.5 - v 8.0.0

ni3tzsch3 avatar Jul 26 '22 15:07 ni3tzsch3

Hi

adding the proposed workaround is breaking standard component

[image: image.png]

Removed the !important, and now is displayed fine. On the other hand I don't know if it will also fix the errors.

.mat-calendar-body-cell { position: relative; }

On Tue, Jul 26, 2022 at 9:51 PM shanu-1119 @.***> wrote:

Hi @cmester https://github.com/cmester @ni3tzsch3 https://github.com/ni3tzsch3 ,

can u try adding this css

.mat-calendar-body-cell { position: relative !important; }

— Reply to this email directly, view it on GitHub https://github.com/h2qutc/angular-material-components/issues/269#issuecomment-1195859074, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARKPW26AN7HGZ3DUNM7ZEDVWAXTJANCNFSM5XT3HZJA . You are receiving this because you were mentioned.Message ID: @.***>

cmester avatar Aug 03 '22 12:08 cmester

There are multiple style errors, caused by conflicts with the styles of the standard mat-datepicker.

I can reproduce them easily when i have a datetime picker and a standard datepicker (in the same view). When you open the datetimepicker, then the standard datepicker, you can see a problem in mat-calendar-arrow caused by borders and sizes, and then, if you open the datetimepicker again, all styles are messed up (as you guys mentioned in this issue).

I spent some time trying to fix these issues, and as a workaround, add this to your styles.scss:

.mat-calendar-arrow {
  border: none !important;
  width: 10px !important;
  height: 5px !important;
}
ngx-mat-calendar-header .mat-calendar-arrow {
  border-left: 5px solid transparent !important;
  border-right: 5px solid transparent !important;
  border-top-width: 5px !important;
  border-top-style: solid !important;
  width: 0 !important;
  height: 0 !important;
}
ngx-mat-month-view .mat-calendar-body-cell {
  position: relative !important;
}

All issues gone!

Maybe the solution is wrap the datetimepicker styles inside a class, to not mess with the native styles.

FYI @cmester @ni3tzsch3 @johnbu2 @h2qutc @kaihenzler

Sergiobop avatar Aug 28 '22 15:08 Sergiobop

+1 image

while using both the ngx-mat-datetime-picker and mat-datepicker the angular material's mat-datepicker UI is Breaking

done a work around here

https://angular-ivy-wwze6q.stackblitz.io

sudhagarmsd5 avatar Aug 31 '22 13:08 sudhagarmsd5

@sudhagarmsd5 can you pls post your workaround here? the stackblitz is not working anymore?!


have found out a way: Wrapping @Sergiobop's solution (and some additions from me) in ngx-mat-datetime-content

.mat-calendar-body-cell {
  position: absolute; // necessary for working in Firefox
}

ngx-mat-datetime-content {
  .mat-calendar-arrow {
    border: none !important;
    width: 10px !important;
    height: 5px !important;
  }
  ngx-mat-calendar-header .mat-calendar-arrow {
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-top-width: 5px !important;
    border-top-style: solid !important;
    width: 0 !important;
    height: 0 !important;
  }
  ngx-mat-month-view .mat-calendar-body-cell {
    position: relative !important;
  }
  ngx-mat-timepicker {
    input.mat-input-element {
      cursor: default;
    }
    .mat-form-field-underline,
    .mat-form-field-subscript-wrapper,
    .mat-form-field-label-wrapper {
      display: none;
    }
    .mat-form-field-appearance-legacy .mat-form-field-infix {
      padding: 0;
      border-top: 0.2rem solid white;
    }
    .mat-form-field {
      line-height: 1rem;
    }
  }
}

jhwegener avatar Dec 07 '22 14:12 jhwegener

@jhwegener your solution was not working for me but i fixed it with reassign materials default styles to the mat-calendar body cell

mat-calendar .mat-calendar-body-cell {
  height: 100%;
  position: absolute;
}

SchraderR avatar Jan 20 '23 10:01 SchraderR

seems to be fixed with version 16

dominikbrazdil avatar Mar 15 '24 11:03 dominikbrazdil