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

fix(datepicker): add class "show" to visible datepicker dropdown #2013

Closed
wants to merge 1 commit into from

Conversation

wpanas
Copy link

@wpanas wpanas commented Dec 6, 2017

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.

@@ -306,8 +306,10 @@ export class NgbInputDatepicker implements OnChanges,
}

private _applyPopupStyling(nativeElement: any) {
this._renderer.removeClass(nativeElement, 'd-inline-block');

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?

Copy link
Author

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.

Copy link
Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi
There is no more the d-inline-block class on the datepicker element, I removed it in pull request
#1614
This pull request will solve #2088.
BR

Copy link
Author

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

@mboughaba
Copy link

Hi,
Using bootstrap 4.0.0, ngb 1.0.0-beta.9 and after applying this PR manually the datepicker not showing issue was fixed.

Cheers,

@wpanas
Copy link
Author

wpanas commented Jan 30, 2018

Ok. I removed the controversial line

@wpanas
Copy link
Author

wpanas commented Mar 18, 2018

How changes in typeahead component apply to datepicker popup?

@pkozlowski-opensource
Copy link
Member

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

@wpanas wpanas deleted the dropdown_show_simple branch March 20, 2018 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants