Has anyone been able to enable showInput when using the color picker in a block?
Permalink
I am using a color picker in a block that I am making and have been unable to get showInput to work (all other options work). Having the ability to allow for text input would be extremely useful.
http://bgrins.github.io/spectrum/#options-showInput...
An example of trying to enable showInput:
I do know that showInput does work in concrete5. The color picker used in the Customize Theme section uses it.
Are the Customize Theme section color pickers different than the regular color pickers?
I found showInput being used here.
concrete\src\StyleCustomizer\Style\ColorStyle.php
Thank you
http://bgrins.github.io/spectrum/#options-showInput...
An example of trying to enable showInput:
$color = Core::make('helper/form/color'); $color->output('feedBackgroundColor', $feedBackgroundColor, array('showInput'=>'true','preferredFormat'=>'hex'));
I do know that showInput does work in concrete5. The color picker used in the Customize Theme section uses it.
Are the Customize Theme section color pickers different than the regular color pickers?
I found showInput being used here.
concrete\src\StyleCustomizer\Style\ColorStyle.php
print "<input type=\"text\" name=\"{$inputName}[color]\" value=\"{$color}\" id=\"ccm-colorpicker-{$inputName}\" />"; print "<script type=\"text/javascript\">"; print "$(function() { $('#ccm-colorpicker-{$inputName}').spectrum({ showInput: true, showInitial: true, preferredFormat: 'rgb', allowEmpty: true, className: 'ccm-widget-colorpicker', showAlpha: true, value: " . $json->encode($color) . ", cancelText: " . $json->encode(t('Cancel')) . ", chooseText: " . $json->encode(t('Choose')) . ", clearText: " . $json->encode(t('Clear Color Selection')) . ", change: function() {ConcreteEvent.publish('StyleCustomizerControlUpdate');} });});";
Viewing 15 lines of 16 lines. View entire code block.
Thank you
Been around this loop several times ourselves but still not resolved it unfortuntaley. Prob be looking again come the new year so will post back if uncover anything useful. Totally agree that user input is pretty much essential - especially when you need to match a brands color scheme.
It is good to know that I am not the only one experiencing this.
After more testing of this - the actual input field does work.
Unfortunately the dialog box is interfering with it and preventing 'focus'. In Firebug I opened up the color picker in one of our blocks and removed the dialog completely and the input field works just fine.
Just need to understand now what is messing up the focus in the first place to try and come up with a fix. At least we are one step closer anyway ;)
Unfortunately the dialog box is interfering with it and preventing 'focus'. In Firebug I opened up the color picker in one of our blocks and removed the dialog completely and the input field works just fine.
Just need to understand now what is messing up the focus in the first place to try and come up with a fix. At least we are one step closer anyway ;)
Have you posted to Github regarding this issue yet?
Not yet - only just figured this out. I will do though today at some point.
This has been submitted to GitHub and Andrew has marked as a bug and added it to the 5.7.4 milestone. If anyone else has anything else to offer on this one then the issue can be found and tracked here -https://github.com/concrete5/concrete5-5.7.0/issues/1777...
Yeah, this is a low priority at the moment so we'd love to get some community help on this one.
Andrew, my colleague has spent some time on this and has now submitted a pull request on GitHub that fixes this issue:
https://github.com/concrete5/concrete5-5.7.0/pull/1803...
https://github.com/concrete5/concrete5-5.7.0/pull/1803...
That is excellent.
Please tell your colleague thank you from me.
Please tell your colleague thank you from me.