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

submit button contained in form #775

Merged
merged 7 commits into from
Aug 3, 2022
Merged

submit button contained in form #775

merged 7 commits into from
Aug 3, 2022

Conversation

wackyleo459
Copy link
Contributor

New Device Name screen:

Issue: When typing the device name, cannot submit by keyboard "enter" button

Resolution:

  • Wrapped input and buttons within a form, enabling auto submit for key enter
  • Fixed: Even when there was no name given, submit button would fire which resulted in an empty device name. Now if no text is given form will not be submitted.

@wackyleo459 wackyleo459 requested a review from nmattia July 28, 2022 22:02
Copy link
Collaborator

@nmattia nmattia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

In other places in the codebase we preventDefault() when submitting the form. Is that necessary? Or can you just perform the action in onsubmit like you do here?

src/frontend/src/styles/main.css Outdated Show resolved Hide resolved
@wackyleo459
Copy link
Contributor Author

Thanks!

In other places in the codebase we preventDefault() when submitting the form. Is that necessary? Or can you just perform the action in onsubmit like you do here?

We discussed it's safer to still include preventDefault(), although it works without because there is no actual html form data submission.

Copy link
Collaborator

@nmattia nmattia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, thanks!

@wackyleo459 wackyleo459 merged commit 90e4bcf into main Aug 3, 2022
@wackyleo459 wackyleo459 deleted the keyboardEnter branch August 3, 2022 17:00
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.

2 participants