Topic: MDB Stepper Form Enter Key Pressed Issues
athleticssoftware
pro asked 7 months ago
Expected behavior We are using an MDB Stepper inside of a form. When an input control has focus and a user hits enter on their keyboard the stepper should not go backwards to the last (previous) step.
i.e. When the user presses the enter key while inside an input control it should do nothing unless that input control is a calendar or a select.
Actual behavior In our stepper for some reason, when an input control has focus and the user presses enter on their keyboard the stepper goes backwards to the last (previous) next step. This happens even if the form does not meet validation requirements. When a user tabs into an input control that happens to be a MDB calendar and hits enter it doesn't show the calendar modal and it returns back one step.
Resources (screenshots, code snippets etc.) I can share the code in part or privately if requested (there is a lot of it).
Krzysztof Wilk
staff answered 6 months ago
You have to add .linear class to your treeview ul (second line in the snippet). Also, you have to add the required attribute to all of your required inputs, so your stepper won't go into another step if previous values are empty :)
Best regards
Answered
- User: Pro
- Premium support: No
- Technology: jQuery
- MDB Version: 4.19.0
- Device: Desktop
- Browser: FF 80.x & Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: No
Tomek Makowski staff commented 7 months ago
Hi, could you show me your code in the snippet code editor?
Snippet code editor: https://mdbootstrap.com/snippets/
Regards
athleticssoftware pro commented 7 months ago
Sure can. I won't be able to send it until next week though (we have limited hours because of Covid19).
Tomek Makowski staff commented 7 months ago
Ok, so I'm waiting
athleticssoftware pro commented 6 months ago
Hi Tomek, is there a way to send you a direct message with a link to the snippet with our code in it? Or is that something you can already see on our account?
Tomek Makowski staff commented 6 months ago
just create a snippet here:
https://mdbootstrap.com/snippets/
And then paste your code into this snippet, copy the URL link and send this URL here
Regards
athleticssoftware pro commented 6 months ago
Sorry for the delay. I pasted the code here: https://mdbootstrap.com/snippets/jquery/athleticssoftware/2503259