Skip to content
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

[SpeedDial] Speed dial action binding enter event #12862

Closed
basicfu opened this issue Sep 13, 2018 · 10 comments · Fixed by #17301
Closed

[SpeedDial] Speed dial action binding enter event #12862

basicfu opened this issue Sep 13, 2018 · 10 comments · Fixed by #17301
Assignees
Labels
component: speed dial This is the name of the generic UI component, not the React module!

Comments

@basicfu
Copy link

basicfu commented Sep 13, 2018

When I click on speedDialAction onClick event after,speedDialAction close after,Still triggered onClick event
repeat url: https://material-ui.com/lab/speed-dial/
image

@mbrookes mbrookes added the status: waiting for author Issue with insufficient information label Sep 13, 2018
@mbrookes
Copy link
Member

mbrookes commented Sep 13, 2018

@basicfu Sorry, I can't understand what you're saying. Please use the issue template, and provide a reproducible example (edit the docs example in CodeSandbox)

@basicfu
Copy link
Author

basicfu commented Sep 13, 2018

I'm sorry, my English is very poor
The official demo can reproducible: https://material-ui.com/lab/speed-dial/
speedDialAction After closing the keyboard can still onClick

@basicfu
Copy link
Author

basicfu commented Sep 13, 2018

@mbrookes
repeat steps:

  • onClick addIcon
  • onClick copyIcon
  • the mouse left copyIcon
  • press enter
  • press enter
  • press enter
    problem: Enter can trigger handleMsg event,When I click on a blank place at will,Enter events disappear
    demo: https://codesandbox.io/s/j2m7wrjjm5

@basicfu
Copy link
Author

basicfu commented Sep 17, 2018

@mbrookes Can you help me?

@heregoesnoth
Copy link

@mbrookes the problem is: when you click in some option (in this case, copyIcon), you can press enter that will trigger the action again, but when mouve leave and the options are close, you still can trigger the action.

@basicfu workaround

  handleMsg = () => {
    if (this.state.open) {
      this.setState(state => ({
        msg: state.msg + "close.."
      }));
    console.log("msg...");
    }
  };

@basicfu
Copy link
Author

basicfu commented Sep 17, 2018

@lucasgms16 Thank you very much, this will solve the problem,When my keyboard events in the parent layer when listening,I need to deal with the state in the parent layer
@mbrookes I want to know,when mouse leave and the options are close,press enter whether can also trigger action

@oliviertassinari oliviertassinari added package: lab Specific to @mui/lab and removed status: waiting for author Issue with insufficient information labels Sep 17, 2018
@mbrookes mbrookes added the component: speed dial This is the name of the generic UI component, not the React module! label Sep 18, 2018
@mbrookes
Copy link
Member

@lucasgms16 Thanks! Do you want to work on a fix?

@heregoesnoth
Copy link

@mbrookes sure!

@eps1lon
Copy link
Member

eps1lon commented Oct 31, 2018

Did some quick testing and while it is trivial to put the focus back on the dial it is not viable to use this with our current demo setup because onFocus will be triggered. I think we should provide a full a11y solution and this is quite hard if users can control the open state.

My preferred solution would be to have a good menu implementation that considers all a11y concerns and then use this in SpeedDial and Menu. Right now those concerns are not in one place. What do you think @mbrookes?

@mbrookes
Copy link
Member

Makes sense in principal to share with menu. Controlled components are the preferred approach in Material-UI though.

eps1lon added a commit to eps1lon/material-ui that referenced this issue Jun 8, 2019
@oliviertassinari oliviertassinari self-assigned this Sep 10, 2019
@oliviertassinari oliviertassinari removed the package: lab Specific to @mui/lab label Jan 9, 2021
@oliviertassinari oliviertassinari changed the title [Speed Dial]speed dial action binding enter event [SpeedDial] Speed dial action binding enter event Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: speed dial This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants