mui / material-ui Public
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
Firefox onClick not working in button #13957
Comments
|
@michaelgriffithus Move the onClick listener from the SVG to the icon button. import React from 'react';
class NavDrawer extends React.Component {
render() {
return (
<button>
<svg
onClick={() => {
console.log('wtf');
}}
>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</button>
);
}
}
export default NavDrawer;The matter was also discussed in https://stackoverflow.com/questions/26402033/missing-click-event-for-span-inside-button-element-on-firefox. |
|
Thank you @oliviertassinari |
This was cleared by by this comment mui/material-ui#13461 (comment) and the relevant issue mui/material-ui#13957. I had to move the onClick to the button from the thing below the button. It seems to work now in Firefox. madliberation-96
Firefox seems to need onClick to be at the Button level, not on components within the Button. mui/material-ui#13957 https://stackoverflow.com/questions/26402033/missing-click-event-for-span-inside-button-element-on-firefox madliberation-105
It apparently sometimes doesn't work with the onClick listener being registered on the SVG instead of the parent Button component. See mui/material-ui#13957
|
Hello, I am on this error page because I am attempting to add a callback to MUI
Wrapping the Is there any way to add a callback to the CloseIcon? |

I have a simple react application that is using Material-UI components. The application menu drawer doesn't appear in FF 60.4 but works fine in Chrome.
If I change the state of the drawer in the developers toolbox the drawer appears. Its like the menu icon onClick event handler isn't firing: https://codesandbox.io/s/wo29099yvl
Any help would be appreciated, thanks in advance!
The text was updated successfully, but these errors were encountered: