outl1ne / nova-color-field

A Laravel Nova package that adds a color picker to Nova's arsenal of fields.
MIT License
25 stars 13 forks source link

feat: add disabled attribute when readonly property is true #20

Open scouser03 opened 1 year ago

marttinnotta commented 1 year ago

Hi and thank you for your contribution!

Readonly and disabled property have different purposes and should not be mixed like that. While readonly prevents user from editing the field disabled state will in some browser remove event listeners entirely from input.

I suggest to change your code so that instead of disabled state use readonly state instead and don't allow toggling picker when it's in readonly mode.