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

Button clicks dont work on mobile devices for nested components #340

Open
aandis opened this issue Dec 9, 2019 · 3 comments
Open

Button clicks dont work on mobile devices for nested components #340

aandis opened this issue Dec 9, 2019 · 3 comments

Comments

@aandis
Copy link

aandis commented Dec 9, 2019

Describe the bug
If the item inside {{#item.handle}} or {{#group.item}} is an ember component with buttons, button clicks dont work on mobile devices.

To Reproduce
Steps to reproduce the behavior:

  1. Go to twiddle.
  2. Simulate mobile device on Chrome/Desktop or try it out on a real mobile device.
  3. Try clicking the buttons.

Expected behavior
Button clicks and other touch events should work on mobile devices.

Carried over from #339

@MathijsPeerlings
Copy link

Is there already a proposed solution for this?

@NullVoxPopuli
Copy link
Contributor

Not that i've seen. A PR would be most helpful!

@BvG-Gynzy
Copy link

Skipping the preventDefault for touchstart works for me.

    if (startEvent.type !== 'touchstart') {
      //click event (touch) of child elements is prevented by the following line
      startEvent.preventDefault();
    }

Also _preventClick should be skipped for touch, otherwise clicking after drop does not work the first time.

    const isTouch = event.type === 'touchstart';
    this._drop(isTouch);
    if (!isTouch) {
      this._preventClick();
    }

Will create PR later.

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

No branches or pull requests

4 participants