bgrins / spectrum

The No Hassle JavaScript Colorpicker
https://bgrins.github.io/spectrum/
MIT License
2.32k stars 588 forks source link

Remove stopPropagation on choose & cancel buttons #392

Closed kesun closed 8 years ago

kesun commented 8 years ago

It's not ideal to use stopPropagation() on these two bottons in case if users of the library wishes to intercept the clicking event on them and perform explicit actions on colour picked through hex code, for example. There are also plenty of other places that use stopPropagation that may need some cleanup, but let's start with these two for now.

bgrins commented 8 years ago

I think this should be OK. We are preventing the event from bubbling up to document and causing a hide here so should be fine to propagate on the buttons: https://github.com/bgrins/spectrum/blob/080939cadc5c45fd265bc1cab923a436bb97398e/spectrum.js#L323-L324.

What about the clearButton (in between the two in the PR). That should be OK to remove the call to stopPropagation also, right?

kesun commented 8 years ago

That seems fine to me, thanks for the response! :+1: