-
-
Notifications
You must be signed in to change notification settings - Fork 633
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
Touch events not supported? #1001
Comments
We use them and they are working just fine... Is this again old version of JSX plugin issue? Make sure you have v3+. Edit: I misread, thought it was about onMouseMove need to test this. |
Seems like some events are missing, which also can be read here: |
These have worked in the past, just not via the synthetic event system. Can you try with the event name being all lowercase? |
@trueadm Are non synthetic events created by setting the name to lowercase? |
@deamme all lowercase events use the native event system and bypass Inferno's system entirely. |
@trueadm Oh. Let me test. I will keep you posted. |
@trueadm I updated the event names to lowercase but they are not being rendered. Somehow Inferno is removing it? This is what I did:
Based on what you are saying this should work. Not sure what is going on here. |
@hguillermo Can you show what the compiled JSX code looks like? I have a feeling you might be using an old version of the JSX plugin for Inferno. |
@trueadm I am using "babel-plugin-inferno": "^3.1.0" and I just updated inferno to 1.6.1 but I am getting this error now: |
@trueadm Inferno is removing those events. I tested using "babel-plugin-inferno": "^3.1.0" and "inferno": "1.5.6". Input
Output
cc @deamme |
Are you looking at the rendered HTML lookup? Events won't appear there, as they're added as properties to th DOM Node, rather than as attributes. You'll need to access the nodes property to find these. |
oh I see. I can see those events now. They are not being fired but maybe that is an error in my code. I will debug and keep you posted. Thanks! |
@trueadm I fixed it doing this:
From the React original code:
Thanks for all your help. |
I am going to close this issue. Not an inferno error. Thanks again for all your help. |
@hguillermo you can use camelCase too, like React – well you should be. It sounds like the issue was the fact your events weren't bound the the class. Were you using |
@trueadm From the react code: and of course in React I have this in the constructor:
I try that in inferno but it didn't work. I am going to try again. Maybe after many tries and errors I got confused or so. |
New version 3.0.2 released. Closing |
Hi there! Have the same problem here. We are using "nuka-carousel": "^2.0.4" and migrated from preact to infernojs recently. The problem is even there with "inferno": "^3.3.1" respectivly "inferno-compat": "^3.3.1". The mouse events seems to work, but on mobile devices the touchevents are not even registered. Is that maybe a regression or smth? or more like an inferno-compat issue? |
To verify, I swapped inferno-compat with preact-compat. And the touch events are properly registred in the EventListener section -.- (and working fine). Did I miss something that InfernoJS is not supported on Touch Devices? 🤔 |
@koellcode Can you track down the issue you are having? PR would be nice :) |
@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 |
Having the same issue - touch events are not showing up as bound. Using |
@tomlagier can you create jsFiddle to reproduce the issue please. https://jsfiddle.net/wt5vL603/ |
Sure: https://jsfiddle.net/97w3ounh/1/ Note that the div with all the touch handlers doesn't get any listeners bound. |
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 |
@Havunen onTouchStart is still not on the docs? |
it's also good if we can add |
I am migrating a code like this from a React codebase:
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!
The text was updated successfully, but these errors were encountered: