-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Datepicker in dropdown closes both on date selection #6736
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
Comments
Any updates? It blocks updating project to Angular 19 as peerDependencies of ngx-bootstrap in 19.0.2 has deps on Angular 19... |
The same is true when datepicker is inside popover with I see following workarounds:
2 Devs: make/return option to have custom container for datepicker dropdown or an option to suppress clicks for datepicker container on a per use basis. |
I used following workaround for my popover solution: and the handler itself
Works for me, I can interact with datepicker and the hit save in a popover |
@dkhavilo as a workaround works for me as well, thanks |
Uh oh!
There was an error while loading. Please reload this page.
When using the datepicker inside a dropdown, selecting a date closes not only the datepicker but also the dropdown.
This issue started occurring since ngx-bootstrap v18.0.2 after the changes introduced in this fix, specifically after adding the following line of code:
ngx-bootstrap/src/component-loader/component-loader.class.ts
Line 229 in 7d87cb4
For some reason, this change emits a click event, which triggers the toggle click with false as its value. As a result, the
hide()
method in BsDropdownDirective is called, causing the dropdown to close unexpectedly.Relevant call stack and behavior:
ngx-bootstrap/src/dropdown/bs-dropdown-toggle.directive.ts
Line 50 in 7d87cb4
ngx-bootstrap/src/dropdown/bs-dropdown.directive.ts
Line 277 in 7d87cb4
Reproduction
You can reproduce the issue in the following StackBlitz Example
Versions of ngx-bootstrap, Angular, and Bootstrap:
Expected Behavior
Selecting a date in the datepicker should only close the datepicker while keeping the dropdown open.
Actual behaviour:
Selecting a date in the datepicker closes datepicker and dropdown.
Additional Context
This behavior was not present in versions prior to v18.0.2 and appears to be a regression due to the linked PR.
Would appreciate any insights or potential workarounds in the meantime. Thanks!
The text was updated successfully, but these errors were encountered: