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

Date picker overlay does not work correctly with mat-form-field #517

Open
akcoder opened this issue Feb 23, 2023 · 3 comments
Open

Date picker overlay does not work correctly with mat-form-field #517

akcoder opened this issue Feb 23, 2023 · 3 comments

Comments

@akcoder
Copy link

akcoder commented Feb 23, 2023

Versions

  • Angular version: 15.2
  • component version: 6.0.4

Describe the bug
When using a <mat-form-field> form control, the date picker popup is cutoff by the form field frame. https://imgur.com/a/b6TwSz5

To Reproduce
Create a form field using:

<mat-form-field>
    <mat-label>Date Range</mat-label>
    <input type="text" name="daterangeInput" matInput [showCustomRangeLabel]="true"
            [showRangeLabelOnInput]="true"
            [locale]="{customRangeLabel: 'Custom range'}" #dp
            ngxDaterangepickerMd [ranges]="ranges" [maxDate]="maxDate"/>
    <div matSuffix>
        <mat-icon (click)="$event.stopPropagation(); openDatePicker()" role="button">date_range</mat-icon>
    </div>
</mat-form-field>

Expected behavior
The full overlay to show.

Screenshots
Working (without mat-form-field)

Broken (with mat-form-field). As can be (barely) seen in this screenshot, only the top dozen or so pixels of the overlay are visible.

Stackblitz link
N/A

Additional context
The ngx-daterangepicker-material control worked correctly with Angular 14. I suspect it broke with ng15 with the march to using MDC (material design components for web).

@jeevan900929
Copy link

jeevan900929 commented Feb 24, 2023

I am facing a similar issue where the picker is clipped within a material dialog's content area.

I have used drops='up', which causes it to break:
Screenshot+29+2023-02-24+20 11 02

@kimlambiguitoppolis
Copy link

kimlambiguitoppolis commented Mar 3, 2023

image
same issue

@zebt
Copy link

zebt commented Mar 22, 2023

In my case, adjusting the styles of mat-form-field child class element helped: (apply the style with additional parent class)

.mdc-text-field {
    overflow: unset !important;
    will-change: auto !important;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants