-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(datepicker): change overlay position strategy so the calendar is kept on-screen #11607
Conversation
src/lib/datepicker/datepicker.ts
Outdated
@@ -445,7 +445,7 @@ export class MatDatepicker<D> implements OnDestroy, CanColor { | |||
.withTransformOriginOn('.mat-datepicker-content') | |||
.withFlexibleDimensions(false) | |||
.withViewportMargin(8) | |||
.withPush(false) | |||
.withPush(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed altogether since pushing is enabled by default. Also it will keep the datepicker in the viewport if the user tries to scroll away, which we probably don't want. You can enable pushing only for the first positioning by enabling locking using withLockedPosition()
.
@mmalerba is this something we want enabled on the datepicker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fail. I was looking straight to #6965 and didn't take into account what withPush(true)
would really do.
I'll take it away and add withLockedPostion()
. It won't change the overall behavior, as the scrolling is locked while the panel is opened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crisbeto yep, it looks kinda broken on small screens without this.
Hi @julianobrasil! This PR has merge conflicts due to recent upstream merges. |
@julianobrasil yeah this should be good to go now |
…kept on-screen (angular#11607) * change withPush strategy to true * address @crisbeto's comment
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #6965.