Opened 6 years ago
Last modified 6 years ago
#46780 new defect (bug)
wpColorPicker() close() method uses iris 'toggle' instead of 'hide' which can unexpectedly open the color pane
Reported by: | maximus80 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | minor | Version: | 5.1 |
Component: | General | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
Using the close() method, one would expect that the color picker will get closed anyway and that nothing else would happen, even if the picker in question was already closed. However, when calling the close() method on an already closed picker (e.g. when you call close() on a set of three pickers, where only 2 might be open), the color pane will get displayed.
While the close() method correctly will remove the wp-picker-open class and will set the aria-expanded attribute to false regardless, the actual iris picker is just using toggle:
this.element.iris( 'toggle' );
Instead, it would be safer to use
this.element.iris( 'hide' );
which would also be more in line with how the class and attribute are handled.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Thanks for the report, @maximus80!
Are you interested in creating a patch for this?