optimistex/ngx-select-ex

Custom click directive stoped working

Closed this issue · 6 comments

Added custom directive:

@Directive({
  selector: '[ngxSelectMultiClear]'
})
export class NgxSelectMultiClearDirective {
 @Output() ngxSelectMultiClear = new EventEmitter();

 @HostListener('click', ['$event'])
 onClick(event) {
    console.log(event)
 }
}

In template:

<ngx-select  (ngxSelectMultiClear)="customFunc()"
                        ...
></ngx-select>

On click - nothing happens. In 3.6.10 and previous works fine

@eugene-gv Please, reproduce the issue within an example.
Make fork from that: https://stackblitz.com/edit/ngx-select-ex-scratch

There is integrated clear button, so no need in such directive, sorry.
But custom click on selected option don't work anyway.
check here: https://stackblitz.com/edit/ngx-select-ex-scratch-btus6p

image
I need it to work while clicking text inside selected element. Is it possible?
Now when i click anywhere inside selected element console log is not triggered

Thanks, Konstantin!