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
- Added touch events to synthetic event list Github #1001 — committed to infernojs/inferno by Havunen 7 years ago
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
ontouchstartsyntax, and its also preferred to useonTouchStartbecause then there will be only 1 listener bound to DOM.it’s also good if we can add
onSwipeevent 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:
From the React original code:
Thanks for all your help.
@deamme all lowercase events use the native event system and bypass Inferno’s system entirely.