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

generate img no longer triggers form submit #9819

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

Israellund
Copy link
Collaborator

Link to Issue

Closes: #9812

Description of Changes

  • If a user clicks on Generate Image, enters a prompt, then presses return/enter, the form is no longer submitted and the user is no longer redirected to the next page. Instead pressing return/enter triggers the onClick to generate an image.

"How We Fixed It"

add an onKeyDown to the <div> holding the input and button for generating images.

Test Plan

  • This was in contests because only there is CWImageInput used without being required
  • create a contest
  • select a topic and name your contest
  • generate an image/input a prompt
  • click return/enter instead of clicking on the Generate button
  • confirm that your image is now being generated and you were not redirected to the next page
Screen.Recording.2024-11-05.at.4.17.10.PM.mov

@mzparacha
Copy link
Contributor

Lets also do .trim() on this line

@Israellund Israellund merged commit 3d88afa into master Nov 6, 2024
10 checks passed
@Israellund Israellund deleted the israel.9812.generate-image-triggers-form-submit branch November 6, 2024 16:55
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.

[Bug]: Generate image skipping to next page in contest workflow rather than generating an image
3 participants