Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color picker does not work properly on mobile. #204

Open
liesahead opened this issue Sep 26, 2019 · 4 comments
Open

Color picker does not work properly on mobile. #204

liesahead opened this issue Sep 26, 2019 · 4 comments
Labels

Comments

@liesahead
Copy link

liesahead commented Sep 26, 2019

When you drag the color selection cursor, even in your demo, page background moves along with cursor.

To reproduce:

Option 1: open your demo website from mobile browser and try to pick color, drag color selection cursor.

Option 2: open chrome, toggle device toolbar, select mobile devices (for example, iPhone X), reload page and open your demo website. Try to pick color, drag color selection cursor.

Solution suggestion:

Make it possible to stop preventing event's default and stopping propagation somehow. Maybe return event not as value, for example 'colorPickerChange' returns string value, it could be whole event instead.

@sconix
Copy link
Contributor

sconix commented Sep 27, 2019

The dialog should stop propagation of the slider events, but I guess the page moving happens due to some other event that the dialog does not handle. I'll check this as soon as I have time to see what is going on.

@sconix sconix added the bug label Sep 27, 2019
@mayankkataria
Copy link

Did anybody found the solution? I'm also facing the same issue.

@arndwestermann
Copy link

Same for me, its pretty annyoing. :/

@mayankkataria
Copy link

mayankkataria commented Nov 26, 2020

It started working when I installed other node module. Its strange I don't know how it happened. This solution is working in my older project and not working in latest version of ionic-angular (in android).

I just did the following and it worked in my older project:

  1. Paste the following code in HTML and let it be hidden.
<div id="color-picker-section" [hidden]="true">
      <color-sketch id="color-picker" [color]="color"
      (onChange)="changeColor($event)"
      [presetColors]="['#000000', '#FFFFFF']"></color-sketch>
    </div>
  1. npm i ngx-color
  2. import { ColorSketchModule } from 'ngx-color/sketch';
    And then I was able to slide on this ngx-color-picker. When I was commenting the hidden code, again I was unable to slide on it. That's how I concluded this. Hope it helps.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants