When clicking on ng-select, can't do stopPropagation to parent element
See original GitHub issueHi,
I have the following senario:
<div class="parent" (click)="onClick($event)">
<ng-select
[options]="options"
(selected)="onItemSelected($event)">
</ng-select>
</div>
I want to prevent onClick from being called each time I open/close ng-select dropdown.
I try to add (click) handler on ‘ng-select’ and call stopPropagation but it will not close the dropdown since it’s listening to window.click.
Can you please advise?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
When clicking on ng-select, can't do stopPropagation to parent ...
Hi,. I have the following senario: <div class="parent" (click)="onClick($event)"> <ng-select [options]="options" ...
Read more >angularjs - What's the best way to cancel event propagation ...
If you insert ng-click="$event.stopPropagation" on the parent element of your template, the stopPropogation will be caught as it bubbles up ...
Read more >How to Handle Click Events Not Bubbling Up to Document
The most obvious solution is to stopPropagation of the dropdown clicks to prevent the bubble-up. ... This fixes the unwanted expand/collapse of the...
Read more >AngularJS: Stopping event propagation on ng-click
If you do not want to add this code in all ngClick handlers, you can also use a directive which will install a...
Read more >can't bind to 'items' since it isn't a known property of 'ng-select'
B) The stub I suggest isn't a module - it is barely even a component. There is no need to incorporate the stub...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I’ve the same issue, to workaround i did it:
Thanks
Hello, I’ve the same issue with an ng-select within a ngx-bootstrap’s popover
[outsideClick]="true"
(https://valor-software.com/ngx-bootstrap/#/popover#outside-click)On option selection, the popover is automaticly closed. Having
event
returned intoselected
event will allow us to stop propagation.Thanks