Giter Site home page Giter Site logo

Comments (5)

josiahayres avatar josiahayres commented on August 31, 2024 1

An even easier solution would be to add the autoFocus prop onto the submit button, like how the team have done with the demo at: https://material-ui.com/components/dialogs/#alerts

from material-ui-confirm.

jonatanklosko avatar jonatanklosko commented on August 31, 2024 1

@josiahayres that's a good point! Using this approach it's actually possible to configure the behavior globally (demo). @walmat does it remove the need for your wrapper?

from material-ui-confirm.

jonatanklosko avatar jonatanklosko commented on August 31, 2024

Hey! Glad you find it useful, a PR is sure welcome =) One option would be adding onKeyDown here and then see if the pressed key matches what we want. As for the API perhaps a confirmationKey with one of the allowed key values?

from material-ui-confirm.

walmat avatar walmat commented on August 31, 2024

@josiahayres Brilliant. I'm not sure why I didn't think about that!

@jonatanklosko Yep! I think that should be mentioned (if not already) in the readme as to me it seems a pretty commonly desired functionality. Let me know if you want me to open a PR with the updated readme, I'm more than willing. 😄

from material-ui-confirm.

jonatanklosko avatar jonatanklosko commented on August 31, 2024

@walmat I've just added a new section in readme, hopefully it does the job =)

from material-ui-confirm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.