valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

Inline date picker stops propagation of click event #5404

Open livthomas opened 5 years ago

livthomas commented 5 years ago

We're not able to bind click or dblclick events to inline date picker component in our application. It seems that this component stops click event propagation:

https://github.com/valor-software/ngx-bootstrap/blob/development/src/datepicker/themes/bs/bs-datepicker-inline-container.component.ts#L17

Bug description or feature request:

Bug description

Plunker/StackBlitz that reproduces the issue:

StackBlitz: https://stackblitz.com/edit/ngx-bootstrap-click

You can see that only mousedown event is emitted and both click and dblclick are ignored.

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 5.2.0

Angular: 8.2.7

Bootstrap: ?

Build system: Angular CLI, System.js, webpack, starter seed:

Angular CLI

daniloff200 commented 4 years ago

Actually, in your example (dblclick) is working, but, (click) is definitely stopped.

:thinking: I see, that such code exists in all .container components

that was made looong time ago in https://github.com/valor-software/ngx-bootstrap/commit/6472b6fe2d9d5c8b85baf059a72eeef47c2b8925 , so, I assume we need to leave it as it is, or, to rewrite in some way, to allow use (click) and (dblclick).

Gonna investigate, what I can do here

daniloff200 commented 4 years ago

Well, I think I managed to fix that issue with stopPropagation for datepicker, but, looks like that's impossible for daterangepicker because we expect daterangepicker not to close after first click. If you need that for daterangepicker too, please, let me know, it will require more work cc @livthomas

livthomas commented 4 years ago

@daniloff200 We only use datepicker at the moment so that's fine. Thanks a lot for looking into this!