question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datepicker calendar not rendered right when used as ag-grid cell editor

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The calendar should be rendered right when it’s open.

What is the current behavior?

The calendar is rendered on the top left corner of the window

What are the steps to reproduce?

When having an md-input connected to the datepicker and the mat-input-inderline has display: none; the calendar is opened on the top left corner of the page.

Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: https://goo.gl/DlHd6U image

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

The datepicker should render under the connected input

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

Angular - 4.3.1 Material design - 2.0.0-beta.8 CDK - 2.0.0-beta.8

Is there anything else we should know?

I found this issue because my css for ag-grid hides the mat-input-underline.

 .mat-input-underline {
     display: none;
 }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mmalerbacommented, Nov 21, 2017

This is expected if you put display:none on the underline, since the datepicker attaches itself at the underline position. You could try height:0; visibility:hidden; pointer-events:none; to visually hide it, but leave it in the layout so the datepicker knows where to place the popup.

1reaction
willshowellcommented, Aug 28, 2017

@nicolae536 I can’t speak to whether it is/isn’t a valid bug, but currently the datepicker does require the underline for position attachment.

https://github.com/angular/material2/blob/ec4ea060a519282b362db0dd066aab54c4994cc1/src/lib/datepicker/datepicker-input.ts#L251-L257

https://plnkr.co/edit/LJFXEinH661F70aLPaLi?p=preview

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datepicker calendar not rendered right when used as ag-grid ...
When having an md-input connected to the datepicker and the mat-input-inderline has display: none; the calendar is opened on the top left corner ......
Read more >
Using Third-Party Date pickers in ag-Grid
In this post I'll show you how to add third-party date pickers to ag-Grid to allow your users to easily filter and edit...
Read more >
How to adjust datepicker view inside ag grid cell render ...
Two things... First, if you are really using a date picker in a cell renderer, don't. That should be done in a cell...
Read more >
How to Use DatePicker to Edit Grid Cells - Lidor Systems
To enable the DatePicker editor, at first you need to set the editor type of column to Date. Depending on editing mode (Batch,...
Read more >
Creating custom components for ag-grid - /var/
I was trying to practice cellEditor and cellRenderer together. I used the jQuery UI date picker demo shown in the agGrid site for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found