Skip to content

Conversation

@tungct4
Copy link

@tungct4 tungct4 commented Nov 12, 2025

Changes
Fixed image upload button being triggered when pressing Enter in other form fields. Added type="button" attribute to prevent the "Add photos" button and other custom buttons in image upload components from being treated as submit buttons.

Changelog entry

  • Fixed image upload dialog opening unexpectedly when pressing Enter in other form fields

Additional information

  • This fixes the issue where pressing Enter while focused on any input field in a form would unintentionally trigger the image upload file dialog
  • Added type="button" to the following buttons:
    • AddButton in ImageInput component (main "Add photos" button)
  • Buttons using design system components (Button.Default, IconButton) already had correct type attributes
  • This change improves form UX by preventing accidental file dialog triggers during normal form navigation

You may refer to this ticket

@tungct4
Copy link
Author

tungct4 commented Nov 12, 2025

@qroll boss please help review this MR, thanks :)

@tungct4 tungct4 self-assigned this Nov 12, 2025
@tungct4 tungct4 requested a review from qroll November 12, 2025 03:51
@weili-govtech weili-govtech merged commit 5b015f9 into main Nov 12, 2025
1 check failed
@weili-govtech weili-govtech deleted the MOL-19744 branch November 12, 2025 12:21
@weili-govtech
Copy link
Contributor

thanks for the fix, may I request you back port the change to legacy/v1 too

@tungct4 tungct4 restored the MOL-19744 branch November 13, 2025 08:27
@tungct4 tungct4 deleted the MOL-19744 branch November 13, 2025 08:30
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.

3 participants