Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Enable sending touch events #11571

Closed
potmo opened this issue Aug 20, 2013 · 4 comments
Closed

Enable sending touch events #11571

potmo opened this issue Aug 20, 2013 · 4 comments
Labels

Comments

@potmo
Copy link

potmo commented Aug 20, 2013

Since phantomjs sees itself as a touch enabled browser it would be nice to be able to fire off touch events.
We have a page that attaches touch events for mobile browsers (i.e. when ('ontouchend' in window) == true) and click events for desktop.

When automating tests with mocha/jasmine and phantomjs touch events are attached but I can't dispatch any touch events from phantom so I'm a bit stuck.

So please add the possibility to send

  • touchstart
  • touchend
  • touchmove

and possibly

  • touchcenter
  • touchleave
  • touchcancel

to page.sendEvent()

I'm not sure on how multi touch would fit into all of this.

Maybe this would be a nice workaround for #10375 [phantomjs pretends to be a touch browser]

@Havelock-Vetinari
Copy link

It would not be a workaround at all :-) There are web page design which changes behavior when browser reports touch capabilities. I agree what adding those event would be nice thing, but ability to switch off touch capabilities is still very important. I wonder if QT5 version of WebKit allows such in runtime switching

@fancsali
Copy link

fancsali commented Feb 2, 2017

I know, this is an age old ticket, but I believe as time goes by this gets more and more important.

@82antu
Copy link

82antu commented Jan 1, 2018

Hi,

Same Issue Here;

I found the workaround for MouseEvent:

var evt: MouseEvent = document.createEvent("MouseEvent");

instead of

var evt = new MouseEvent("click", {
    bubbles: true,
    cancelable: true,
    view: window
  });

and both Chrome and PhantomJs work, but, the first one doesn t work on PhantomJs for TouchEvent,
and, the second one, doesn t work on Chrome

@stale stale bot added the stale label Dec 25, 2019
@stale
Copy link

stale bot commented Dec 28, 2019

Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 28, 2019
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

4 participants