-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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): add class "show" to visible datepicker dropdown #2013
Conversation
src/datepicker/datepicker-input.ts
Outdated
@@ -306,8 +306,10 @@ export class NgbInputDatepicker implements OnChanges, | |||
} | |||
|
|||
private _applyPopupStyling(nativeElement: any) { | |||
this._renderer.removeClass(nativeElement, 'd-inline-block'); |
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.
Hmmm, do we need to do this since the datepicker widget has d-inline-block
on host?
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.
Yup. Cause some themes will not display this element. For example, they make it not visible by scaling it to 0 and changing opacity to 0, so display doesn't matter at all.
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.
We need to make it truly not visible, so it will have animation once made visible by class "show". It won't be a case with opacity 0, but not all themes use it.
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.
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.
Ok, so I will remove this line in next commit
Hi, Cheers, |
31ef99d
to
6636b1c
Compare
Ok. I removed the controversial line |
How changes in typeahead component apply to datepicker popup? |
They don't "apply" but are related, as both components use dropdown HTML and styling to display popups |
Default behaviour of class "dropdown-menu" in bootstrap 4 is to make it invisble. To make it visible it is necessary to add class "show" to the element. Forcing display: inline-block is dirty fix and cause problems with custom boostrap templates.
Class "d-inline-block" is deleted only when popup styles are applied, so it doesn't cause problems with inline element.