optimistex / ngx-select-ex

Angular based replacement for select boxes
https://optimistex.github.io/ngx-select-ex/
MIT License
111 stars 42 forks source link

Custom click directive stoped working #166

Closed eugene-gv closed 5 years ago

eugene-gv commented 5 years ago

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

optimistex commented 5 years ago

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

eugene-gv commented 5 years ago

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

optimistex commented 5 years ago

@eugene-gv It works with a fix in your code: https://stackblitz.com/edit/ngx-select-ex-issue-166?file=src%2Fapp%2Fapp.component.html image

eugene-gv commented 5 years ago

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

optimistex commented 5 years ago

@eugene-gv Updated: https://stackblitz.com/edit/ngx-select-ex-issue-166?file=src%2Fapp%2Fapp.component.html image

eugene-gv commented 5 years ago

Thanks, Konstantin!