mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.74k stars 32.24k forks source link

"onTouchTap" event isn't working after upgrade. #478

Closed irium closed 8 years ago

irium commented 9 years ago

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.

FirstZero commented 9 years ago

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

mmrtnz commented 9 years ago

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?

irium commented 9 years ago

@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:

anuragsimgeker commented 9 years ago

@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?

irium commented 9 years ago

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

soda29 commented 9 years ago

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

soda29 commented 9 years ago

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

mercuriete commented 9 years ago

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.

hai-cea commented 9 years ago

@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.

irium commented 9 years ago

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

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

pokemane commented 8 years ago

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.