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

Datepicker pop-up positioned incorrectly when inside of Dialog #9730

Closed
MarcosJanuario opened this issue Feb 1, 2018 · 12 comments
Closed

Datepicker pop-up positioned incorrectly when inside of Dialog #9730

MarcosJanuario opened this issue Feb 1, 2018 · 12 comments

Comments

@MarcosJanuario
Copy link

Bug, feature request, or proposal:

Bug

a

What is the expected behavior?

The datepicker is shown right under the input field inside the dialog

What is the current behavior?

The datapicker is shown as absolute position top and left set to 0px

For material Angular JS there was the same issue, and it was fixed

angular/material#5501

@crisbeto
Copy link
Member

crisbeto commented Feb 1, 2018

Can you post an example that shows the issue? You can use this Stackblitz as the base.

@prashantwalavalkar
Copy link

Any solution to this so far?

@MarcosJanuario
Copy link
Author

@prashantwalavalkar I did not get the datepicker to work as it should be (centralized even though it's called over a first dialog). However, I found a way around to have a datepicker as I wanted. What I did was simply getting the mat-calendar component that is used INSIDE THE DATEPICKER. By working with the MatCalendar I can set it where I want and style it the way I want. The parameters expected to setup the calendar are pretty much similar to the ones used with Datepicker.

@jelbourn
Copy link
Member

Closing since we weren't able to reproduce this. Feel free to open a new issue with a reproduction.

@Piraban
Copy link

Piraban commented Apr 5, 2018

I also facing this issue. When I give mat-datepicker inside the widget, shows date picker outside of the window

@prashantwalavalkar
Copy link

Hey..

Sorry for late reply on over all issue. But I am able to resolve this. It was '.mat-input-underline' div which was made hidden as in my design it wasn't required. But it is neccessary for correct positioning of date picker. So I made it hidden visibility hidden & z index to negative value instead of display none.

It started working again as date picker uses position of underline for its position.

Let me know if you are doing same & if this solution works for you.

:)

@lbarbula
Copy link

lbarbula commented May 7, 2018

@prashantwalavalkar I was having the same issue and it was resolved by your fix. Thank you! How did you catch this?

@matosovaolga
Copy link

mat-input-underline

thank you for this fix!

@kamil-homer
Copy link

@prashantwalavalkar thanks!

In some cases you will also need ng-deep
::ng-deep .mat-input-underline{ visibility: visible; z-index: -999; display: block; }

@mani2448
Copy link

mani2448 commented Feb 1, 2019

@jelbourn
Angular Material Datepicker is showing on left side sometimes and cdk-overlay-pane doesn't calculate its position according to datepicker input.
here is the link to images of the issue: https://stackoverflow.com/questions/54479177/why-angular-material-date-picker-sometimes-comes-on-top-left-side-of-screen-inst
11
12

@nibinbaby
Copy link

@prashantwalavalkar : thanks for the fix

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants