#29632 closed defect (bug) (fixed)
wpColorPicker does not respect `hide` option
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch dev-feedback |
Focuses: | javascript | Cc: |
Description
wpColorPicker()
appears to support the hide
option by listing it in the options
property. When iris
is initialized, the hide
value is hardcoded and not taken from the options array. wpColorPicker()
should respect the hide
value passed to it.
To reproduce, initialize a wpColorPicker()
with the following code:
$input.wpColorPicker({ hide: true });
Notice that the color picker is in the closed state. It should be opened when hide is passed.
Attachments (1)
Change History (9)
#3
@
9 years ago
In looking at this some more, I see that there is code that attempts to trigger the click event on the "toggle" element, effectively opening the color picker; however, it is tricky to consistently trigger such an event on a hidden element, which was a requirement in my case.
Respecting the hide
option by passing it to the iris()
function still seems to be a valid solution.
#5
@
9 years ago
- Keywords dev-feedback added
- Owner set to azaozz
- Status changed from new to reviewing
Patch still applies.
@azaozz: Care to take a look at the viability of this?
#8
@
9 years ago
I see no reason any of the options passed to iris should be hard-coded. They should all respect the params passed to wpColorPicker. As such, I've created a new ticket: https://core.trac.wordpress.org/ticket/30182
Added a patch to respect the
hide
option.