-
Notifications
You must be signed in to change notification settings - Fork 65
Color picker does not retain bound value from component #1173
Comments
The current behavior is not really ideal, but for what it's worth, you must set the |
I thought I had a plunker that showed why this wouldn't work, but I believe that I need to go back and figure out why we aren't actually able to do this. I tried hard finding a workaround for this issue yesterday and I kept getting stuck because the value being loaded was not being used when saving. I'll try to reproduce that issue in plunker. |
We may actually be able to use the initialColor in our scenario. The issue with saving might simply be due to the fact that it is often a mystery whatever type your bound property is going to be. Is it a string or is it an instance of SkyColorpickerOutput? Here's a plunker that shows what I mean. |
I spoke with @Blackbaud-JaminQuimby who originally authored this component and we agreed that |
I spent the good part of 3 days attempting to refactor the colorpicker to use only I recommend we leave it as it is. I've addressed the "default value" issue in this PR: #1227. If we want to refactor the colorpicker, I recommend we either wait until UX v.3, or create a Colorpicker2 component. |
Is there a reason why we have to keep SkyColorpickerOutput around besides causing a breaking change if you remove it? I'm pretty sure that this component is barely used at the moment and people who do use it would be glad to get rid of SkyColorpickerOutput. The simple fact that that your property could be either a string or a SkyColorpickerOutput when it comes time to save data is definitely going to cause bugs, especially if people use the |
@Blackbaud-ScottFreeman Agreed. I'll lean into @Blackbaud-PaulCrowder's response, but I'm assuming we'll need to consider a refactor for colorpicker (and perhaps datepicker) for the For reference: https://github.com/blackbaud/skyux2/projects/9 |
Expected behavior
You should be able to bind a property to the color picker and have it retain that value if the user clicks the color picker and closes it without making any changes.
Actual behavior
If you follow the steps above, the color picker is reset to white.
Plunker
https://plnkr.co/edit/TOXjSeIBgmFnp0ZV6meF?p=preview
The text was updated successfully, but these errors were encountered: