jb-tlm / color-charter

https://color-charter.vercel.app
MIT License
0 stars 0 forks source link

Bug #22 - Make "Add" button put color in palette on 1st click: #28

Closed marcioreisjr closed 1 year ago

marcioreisjr commented 1 year ago

Hello Jacob and an folks reviewing this code,

This change is more a "button behavioral" change than technical. The rationale is that the "Add" button should add colors to the bar only after the colors are already defined, and the "Palette" button should define the primary or secondary color based on the selected color.

Currently, the "Add" button triggers some code execution even if there is no previously selected color, exhibiting the undesired behavior listed on this bug.

One solution is to remove this button as suggested in my previous commenthttps://github.com/jb-tlm/color-charter/issues/22#issuecomment-1639080919 because case #13 added the ability to click on any color to add it to the Color Bar.

The proposed solution is to allow the "Add" button to work only after selecting a color with the "Palette" button.

Please, let me know if you prefer to remove the button or otherwise by accepting this PR will conditionally enable the button.

marcioreisjr commented 1 year ago

Addressed your comment. Please, check it out and try it.