kallookoo / wp-color-picker-alpha

Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
GNU General Public License v2.0
131 stars 88 forks source link

Wordpress Customizer issue when Color has a default value set - WP4.7 #8

Closed simonfoxe closed 6 years ago

simonfoxe commented 7 years ago

With the latest version of WP4.7, if a color setting in the Customizer has a default value set, this somehow causes major problem. The customizer won't load the panels / sections / controls properly.

Defining a 'default' value for a color in the Customizer causes the control to output a data-default-color attribute on the tag. This is the only difference that I can see at the HTML level.

Working through the file 'wp-color-picker-alpha.min.js' with a process of elimination I traced the symtoms of the Customizer breaking through to line #254 where this._super() is invoked. If you comment this out, the Customizer loads properly, but the Color control doesn't work properly.

I'm guessing something was updated with WP4.7 and that the JS in this needs to be updated somehow? Looking for opinions, education, and assistance.

raducretu commented 7 years ago

+1

kallookoo commented 7 years ago

ok, @simonfoxe Please send mail to info@dsergio.com with your source code for testing on my system, thanks

kallookoo commented 7 years ago

I checked WordPress Sources and have major update, but using this script directly is not possible. Customize Color Control using underscore template that only allows hue and hex and same what customize-control.js (It is responsible for initializing the wpColorpicker).

I am in the free moments creating a new class to implement this script correctly using hex, rgb(a) and hsl(a).

By the way, what new version of iris is beta, and I do not know what plan the author has to update it, so it is possible that once I update my script it will break again