Skip to content

bug(Datepicker): Calendar's position is being switched to upside even when there's no space to fit it #6965

Closed
@julianobrasil

Description

@julianobrasil

Bug, feature request, or proposal:

Bug.

What is the expected behavior?

(Not sure) If there's no space in the screen nor bellow neither above to show the entire calendar, the bellow position should be the chosen one, so the user could scroll down if necessary (the scrollbar should be shown in this case).

Even better, when there's not enough screen space nor above neither bellow (but enough space in visible browser window viewport) the calendar could be shifted from its base position (defined by the the current rules) trying to fit itself in the available space. But the offset would be limited by the associated input (the input underline should fall in the space between the top and bottom edges of the calendar). Finally, when the total visible screen space wasn't enough to fit the calendar, it would end up in the bellow position, and the scrollbar would be visible.

What is the current behavior?

Notice that the top of the calendar was cropped in the images bellow and there's no scrollbar so one can see the hidden part of it (in fact, there's not viewport above to be scrolled to reveal the hidden part). And it looks like there is space to show it (first image) if it's given an offset.

IMAGE 1:

image

IMAGE 2:

image

IMAGE 3:

image

What are the steps to reproduce?

  1. Open the plunk: https://plnkr.co/edit/QeV9drIbHGEPS4ECFSZ5?p=preview
  2. Shrink the browser window so the calendar doesn't fit in it

What is the use-case or motivation for changing an existing behavior?

Better user experience when working in not-full-screen/small windows

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

@angular/cli: 1.4.0
node: 6.10.3
os: win32 x64
@angular/animations: 4.3.6
@angular/cdk: 2.0.0-beta.10
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/flex-layout: 2.0.0-beta.9-5f198a3
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/material: 2.0.0-beta.10
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/platform-server: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.4.0
@angular/compiler-cli: 4.3.6
@angular/language-service: 4.3.6
typescript: 2.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions