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

[5.x] Fix enter key not submitting confirmation modal sometimes #10721

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

duncanmcclean
Copy link
Member

This pull request adds a keybinding to the "enter" key when editing a section in a blueprint or fieldset.

This PR doesn't do it for tabs - I need to come back to them since I couldn't seem to get them working the same way. 🤔

Closes #10702.

@jackmcdade
Copy link
Member

jackmcdade commented Aug 30, 2024

Hmm, this doesn't seem to work for me. 🤔 Tried Chrome and Safari and still the same behavior.

@duncanmcclean
Copy link
Member Author

Oh, that's a pain. I'll take a look next week.

@duncanmcclean duncanmcclean marked this pull request as draft August 30, 2024 20:31
@jasonvarga
Copy link
Member

Funny. We made it do this on purpose: #10537

@jasonvarga jasonvarga changed the title [5.x] Add enter binding when editing blueprint sections [5.x] Fix enter key not submitting confirmation modal sometimes Sep 9, 2024
@jasonvarga
Copy link
Member

I pushed up fixes.

This is what was happening:

  • When you're in a modal with a text field, hitting enter would "submit" the form.
  • I say "submit" because it seems to just "click" the first submit button, which is Cancel. So the modal would just close.
  • Buttons without a type attribute default to type="submit". The cancel button didn't have a type, so it was considered a submit button. It was missing type="button" which makes the button natively do nothing so you can add JS to it.

Now when you press enter, the first submit button (which is now "Submit") will be clicked and the modal form will submit and close as expected. 😅

@jasonvarga jasonvarga marked this pull request as ready for review September 9, 2024 18:30
@jasonvarga jasonvarga merged commit 502c644 into 5.x Sep 9, 2024
16 checks passed
@jasonvarga jasonvarga deleted the add-enter-bindings-to-blueprint-builder branch September 9, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blueprint → Edit Section: display and instructions not saved on enter
3 participants