Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Lolu chungechunge lwabekwa kunqolobane. Uyacelwa ubuze umbuzo omusha uma udinga usizo.

On simulator "touchend" fires, but not on actual device

  • 5 uphendule
  • 3 zinale nkinga
  • 3 views
  • Igcine ukuphendulwa ngu Ralph Daub

more options

I have developed an app where you can swipe left or right to change content on screen. I detect swipe by looking at x-coord at touchstart and touchend and calculate the distance.

This works fine in the 1.3 simulator, but when I try it on my Open C FF OS 1.3 device, the touchend event never fires. (Touchstart fires as it should).

Please help. Stefan

I have developed an app where you can swipe left or right to change content on screen. I detect swipe by looking at x-coord at touchstart and touchend and calculate the distance. This works fine in the 1.3 simulator, but when I try it on my Open C FF OS 1.3 device, the touchend event never fires. (Touchstart fires as it should). Please help. Stefan

All Replies (5)

more options

Hi steppohak,

You may have better luck finding help on developer-focused forums like StackOverflow:

The following MDN (Mozilla Developer Network) page also has some documentation about touch events:

I hope you're able to find a solution. Please let us know if you have any other questions!

- Ralph

more options

Hi Ralph,

thanks for responding. Unfortunately it does not really help me. (Perhaps I could get help with a workaround from StackOverflow, but I already did one myself - using buttons instead of swipe - at the cost of worse user experience). Both resources are more targeting web app developers, but this is an issue with the _implementation_ in Firefox OS 1.3 (at least for my make and model of device).

Notably the second has a section on "Handling the end of a touch" based on the "touchend" event - but my problem is that the "touchend" event never fires.

I have filed a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1047804 but nothing has happened there so far.

- Stefan

Okulungisiwe ngu steppohak

more options

Hi Steppohack,

Thank you for filing the bug and for providing additional details.

I know that there are apps with swipe capabilities that work well on the ZTE Open C, but I'm not sure how they implemented the swipe features.

I added QA to the bug so that they can investigate this issue.

Thanks,

- Ralph

more options

Thanks Ralph!

Could you provide a pointer to (source for) other apps with swipe? Would be nice to see how they solved it.

Regardless, I think touchend should fire, so the bug should be fixed.

- Stefan

more options

Hi Steppohak,

I don't know the source code of specific apps, but a lot of apps in the Marketplace as well as system apps incorporate swiping.

For example, please look at lines 95-104 of the Browser.js in the B2G's source code:

 /**
* Get elements from index.html.
* Add event listeners.
* Init BrowserDB and search engine.
*/
init: function browser_init() {
this.getAllElements();
// Add event listeners
this.urlBar.addEventListener('submit', this.handleUrlFormSubmit.bind(this));
this.urlInput.addEventListener('focus', this.urlFocus.bind(this));
this.urlInput.addEventListener('blur', this.urlBlur.bind(this));
this.urlInput.addEventListener('touchend', this.urlTouchEnd.bind(this));
this.urlInput.addEventListener('input',
this.handleUrlInputKeypress.bind(this));
this.urlButton.addEventListener('click',
this.handleUrlFormSubmit.bind(this));
this.tabsBadge.addEventListener('click',
this.handleTabsBadgeClicked.bind(this));

And there is also some Touch Events information on the following page:

I hope this information is helpful. Please let us know if you have any questions.

Thanks,

- Ralph