material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

"onTouchTap" event isn't working after upgrade.

Open irium opened this issue 11 years ago • 11 comments

After I've updated to latest NPMs (material-ui to 0.7.2, react to 0.13.1) "onTouchTap" event stopped working. This can be simply proved by running gulp in docs folder. (Not mentioning that there are missing packages in docs/package.json prevents building). After I've installed all missing NPMs and 'docs' server run - clicking at 'DEMO' button or 'menu' button causes no effect.

I'm on Windows.

irium avatar Mar 30 '15 17:03 irium

Seems like the ripple does work on Chrome/Chromium but not on Firefox.. I am on linux.

FirstZero avatar Mar 30 '15 19:03 FirstZero

It seems like the docs example has been encountering on Windows. I haven't encountered that issue using Windows 8.1, however I have been troubleshooting other Windows issues. What missing npm packages have you installed?

mmrtnz avatar Mar 30 '15 19:03 mmrtnz

@FirstZero I've tried Chrome and Opera - doesn't work. Firefox - too. I'm on Windows 8.1 Pro.

@mmrtnz devDependencies: "browserify": "^7.0.3", "reactify": "^0.17.1"; dependencies: "react": "^0.13.1", "react-router": "^0.13.2"

Seems you have them installed globally. Try it on clean NPM installation.

Also, example\package.json outdated too:

  • "material-ui": "^0.7.0",
  • "react": "^0.12.2",
  • "material-ui": "^0.7.2",
  • "react": "^0.13.1",

irium avatar Mar 31 '15 10:03 irium

@irium I'm having the same issue for <Menu /> items. I referenced this src file for callbacks. onToggle works. But onClick onTouchTap don't work. I'm yet to debug. Was wondering if you were able to find a fix?

anuragsimgeker avatar Apr 12 '15 18:04 anuragsimgeker

@anuragsimgeker No, unfortunately not. I guess the bug lies deeply in stack, probably deep in other package react-tap-event-plugin

irium avatar Apr 13 '15 04:04 irium

Is there a way not to depend on react-tap-event-plugin to get components like AppBar working?

soda29 avatar Apr 23 '15 00:04 soda29

I found out that touch tap events cease to work when using a separate vendors file build with gulp.

soda29 avatar Jun 01 '15 23:06 soda29

im having the same problem. is this bug closed? how can i get working the AppBar? i debug enhanced-button and handleTouchTap is never called when i click the appbar's left button, so my callback is never called.

Thanks on advance.

edited: ok, its seems that react doent work properly with tap events. and this will be added in 1.0 if somebody read this post go to this direction: https://www.npmjs.com/package/react-tap-event-plugin is a workaround to get working the tap event on react.

mercuriete avatar Jun 26 '15 11:06 mercuriete

@mercuriete Yes, the tap event plugin is required for this project. Please see: https://github.com/callemall/material-ui#react-tap-event-plugin on how to include it.

hai-cea avatar Jun 26 '15 21:06 hai-cea

@hai-cea But I have https://github.com/zilverline/react-tap-event-plugin installed!

"react-tap-event-plugin": "^0.1.7"

irium avatar Jun 27 '15 15:06 irium

~~I'm having this same issue, and I also have react-tap-event-plugin installed and injected in my app entry point. <MenuItem /> is where I found it first, and I saw that <MenuItem /> doesn't expose the onTouchTap prop like its ancestors <ListItem /> and <EnhancedButton />. Trying to add the prop to the list in <MenuItem /> doesn't seem to have an effect, which seems to be what @mercuriete was seeing I have a <RaisedButton />'s onTouchTap() working in another part of my application, so I'm inclined to believe that the issue is somewhere in the button-listitem-menuitem chain.~~

Turns out, I was not having the same issue; the docs are just inaccurate in this regard. onItemTouchTap is the event defined here but it is not the actual event used in <MenuItem />; it is instead onTouchTap, consistent with the rest of the buttons and with react-tap-event-plugin. Basically, I was using the wrong event in accordance with the docs, and figured it out through context.

pokemane avatar Nov 02 '15 17:11 pokemane