[wp-trac] [WordPress Trac] #30964: Color picker doesn't handles empty values from javascript correctly
WordPress Trac
noreply at wordpress.org
Fri Jan 23 18:30:17 UTC 2015
#30964: Color picker doesn't handles empty values from javascript correctly
-------------------------------+-----------------------------
Reporter: katazina | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Customize | Version: 4.1
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses: javascript
-------------------------------+-----------------------------
Changes (by westonruter):
* keywords: => reporter-feedback
* milestone: Awaiting Review => Future Release
Comment:
Currently the `ColorControl` is doing this when the setting changes:
{{{#!js
this.setting.bind( function ( value ) {
picker.val( value );
picker.wpColorPicker( 'color', value );
});
}}}
From looking the `wpColorPicker` JS, I think we are missing something. It
looks like maybe what needs to happen is this:
{{{#!js
this.setting.bind( function ( value ) {
picker.val( value );
if ( ! value ) {
value = picker.wpColorPicker( 'defaultColor' ); // best
option to reset the UI for color picker?
}
picker.wpColorPicker( 'color', value );
});
}}}
It looks like maybe the Iris library doesn't support a UI with an unset
value.
Please try it out, and see if this is the answer.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30964#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list