Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Aliased color palette #161

Closed
Finorion opened this issue Jun 1, 2016 · 1 comment
Closed

Aliased color palette #161

Finorion opened this issue Jun 1, 2016 · 1 comment
Labels

Comments

@Finorion
Copy link

Finorion commented Jun 1, 2016

Aliased color palette not work in mobile devices.
Not change color on tap.

@berengergermain
Copy link

berengergermain commented Jul 26, 2016

NB : sorry for my (poor) english ^^

Hello,

I had the same problem. It seems that it is due to the mousedown.colorpicker and touchstart.colorpicker listeners registration. On mobile device touchstart.colorpicker event takes advantages on other mouse listeners and because the listener is registered on the picker top element, mousedown on colorpicker-selectors div is never detected.

What I have done to get it work is separate the registration of the listeners : the first one is for saturation, hue, alpha and color sub-element for the mousedown and the touchstart event. The second one is only for selectors sub-element, only for the mousedown event listener.

Juste before event binding (// Bind event) in Colorpicker component class :

I replace
this.picker.on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this.mousedown, this));

By
this.picker.find('.colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha, .colorpicker-color').on('mousedown.colorpicker touchstart.colorpicker', $.proxy(this.mousedown, this));

this.picker.find('.colorpicker-selectors').on('mousedown.colorpicker', $.proxy(this.mousedown, this));

This works fine, but it avoid the custom templating feature because we need a static template to target properly the sub-elements...

I hope that can help you :)

@itsjavi itsjavi added the bug label Sep 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants