zefoy / ngx-color-picker

Color picker widget for the Angular (version 2 and newer)
MIT License
454 stars 142 forks source link

Dialog doesn't open on angular material 15 mat-form-field #330

Open POFerro opened 1 year ago

POFerro commented 1 year ago

Hi :),

I recently upgraded my project to angular 15, and everything worked when I left material components as legacy ones, strangely when I migrated mat-form-field and mat-chips to the newer mdc components the color picker dialog stopped opening. I understand it's odd since there's no dependency on material components from this one but the behavior changed when I changed material components.

Can you help me? Thanks in advance. Best regards and congratulations on the fine component :). POFerro

BZValoche commented 1 year ago

Looks like the focus and click events are not propagated to the child elements anymore, so you need to put the directive colorPicker on the element which receives them.

This used to work with Angular 14 :

<button mat-icon-button >
    <mat-icon [(colorPicker)]="color">palette</mat-icon>
</button>

This works with Angular 15 :

<button mat-icon-button [(colorPicker)]="color">
    <mat-icon>palette</mat-icon>
</button>
Kailijan commented 1 year ago

Sorry, I referenced the wrong issue there.