buberdds / angular-bootstrap-colorpicker

Native AngularJS colorpicker directive. No dependency on jQuery or jQuery plugin is required.
MIT License
419 stars 226 forks source link

Wrong colors displaying in color picker when the model value is empty #145

Closed trimantra closed 7 years ago

trimantra commented 7 years ago

Hi,

I have used many colorpicker instances on a single page. I have encountered an issue when we have a color selected in one picker and have another picker where there is no color selected.

Below is the image of the picker with a value. screenshot from 2017-03-28 12-35-17

Below is the image of the picker on the same page but with empty value and it gets displayed like this screenshot from 2017-03-28 12-57-03

I think that the picker should be initialised with empty value if the model value is empty and it should not use the values of the previously opened picker. Or there should be a way to set the default picker values when the model is empty string.

Please help me out with this.

buberdds commented 7 years ago

@trimantra can u bump to the latest 3.0.26 version and verify it is fixed now? thanks

trimantra commented 7 years ago

@buberdds

Thanks for the reply but the issue doesn't seem to be fixed yet.

Initially it shows the pointer to the top right side (i.e towards the red color) for both the pickers when model values for both the pickers are empty. But after I change the color in the first picker. Opening other picker still shows the color that I selected in the first picker.

buberdds commented 7 years ago

Can you repro this issue using demo page http://codepen.io/buberdds/full/fBAsr/ ?

trimantra commented 7 years ago

Hi,

Thanks for the quick reply. I was not able to reproduce the issue in the demo. May be there is some issue in my setup.

Thanks for your valuable time and support. I deeply appreciate that.

Thanks again.

buberdds commented 7 years ago

Well, just make just you're using v3.0.26.

trimantra commented 7 years ago

OK I have checked that. It works now.

I have also changed the library code to show the pointer on top left when there is no color in the model value.

Thanks a lot. :)

buberdds commented 7 years ago

cool, if you have time you can always create a PR to fix pointer alignment issue:) thanks!

trimantra commented 7 years ago

Hi,

I have created a pull request. Its #146 . Please check it when you have time.