inferno: Touch events not supported?

I am migrating a code like this from a React codebase:

<div
className="discover-slider"
onTouchStart={this.onTouchStart}
onTouchMove={this.onTouchMove}
onTouchEnd={this.onTouchEnd}
>
...
</div>

Those events are working on React but they are not being fired in Inferno. Am I doing something wrong? I think it is just not supported right now. Ideas?

Thanks a lot for all your support guys!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 28 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Seems like touch events were missing in synthetic event list… I added them there now… This is fixed in development and will be available in v4 (next weekend). From then on you don’t need to use ontouchstart syntax, and its also preferred to use onTouchStart because then there will be only 1 listener bound to DOM.

it’s also good if we can add onSwipe event that will allow us to detect swipe directions (left, right, top, bottom).

@Havunen I’ve tried to write a failing test for it. Sadly came not that far … will try to make a gist with inferno starter after work today

@trueadm I fixed it doing this:

<div
className="discover-slider"
ontouchstart={(e) => this.onTouchStart(e)}
ontouchmove={(e) => this.onTouchMove(e)}
ontouchend={(e) => this.onTouchEnd(e)}
>

From the React original code:

<div
className="discover-slider"
onTouchStart={this.onTouchStart}
onTouchMove={this.onTouchMove}
onTouchEnd={this.onTouchEnd}
>

Thanks for all your help.

@deamme all lowercase events use the native event system and bypass Inferno’s system entirely.