Skip to content

Comments

Added hotfix for formsubmit on enter keydown.#2377

Merged
nuke-ellington merged 5 commits intosiemens:mainfrom
1307-Dev:in-3895-form-submit-on-enter-hotfix
Feb 23, 2026
Merged

Added hotfix for formsubmit on enter keydown.#2377
nuke-ellington merged 5 commits intosiemens:mainfrom
1307-Dev:in-3895-form-submit-on-enter-hotfix

Conversation

@1307-Dev
Copy link
Collaborator

@1307-Dev 1307-Dev commented Feb 5, 2026

💡 What is the current behavior?

Form submit on enter down is only limited when the button used is native with type submit. Does not submit when the button used is ix-button with type submit
GitHub Issue Number: #2362
JIRA Issue Number:IX-3895

🆕 What is the new behavior?

The form now submits when ix-button with type=submit is used. Adjusted the utility function to have a more robust submission. Modified the form ready tests to reflect the same behaviour.

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: 6a0fc7e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular Patch
@siemens/ix-docs Patch
@siemens/ix-react Patch
@siemens/ix-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @1307-Dev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where forms containing an ix-button with type="submit" failed to submit upon pressing the Enter key. The changes enhance the form submission utility to reliably detect and activate ix-button elements, ensuring consistent form behavior. Additionally, comprehensive tests have been introduced to validate this corrected functionality across different button types.

Highlights

  • Enhanced Form Submission Logic: The utility function handleSubmitOnEnterKeydown has been updated to correctly identify and trigger form submission when an ix-button with type="submit" is used.
  • Improved ix-button Support: Previously, forms with ix-button[type="submit"] did not submit on Enter keydown; this behavior is now resolved, ensuring consistent form submission across different button types.
  • Updated Test Coverage: The form-ready component tests have been expanded to include scenarios for both native <button type="submit"> and <ix-button type="submit">, ensuring robust validation of the fix.
Changelog
  • packages/core/src/components/input/input.util.ts
    • Refactored the handleSubmitOnEnterKeydown function to prioritize finding a native button[type="submit"]. If not found, it now specifically looks for an ix-button[type="submit"] and then attempts to locate a native button within it to correctly trigger form.requestSubmit().
  • packages/core/src/components/input/tests/form-ready.ct.ts
    • Modified the regression test for form submission on Enter keydown to iterate and test both native <button type="submit"> and <ix-button type="submit"> elements, ensuring the fix is verified for both.
    • A regressionTest.only was temporarily added to the new test loop, which should be removed before merging.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a hotfix to ensure forms are submitted on 'Enter' key press when an ix-button with type="submit" is used. The changes involve updating the handleSubmitOnEnterKeydown utility function and expanding the test suite to cover this new scenario.

The changes are generally good and address the issue described. The following comments have been retained as they are valid and do not conflict with the provided rules:

  • A suggestion to simplify the logic in input.util.ts by removing what appears to be a redundant code block, which would improve maintainability.
  • A request to remove .only from the new test case in form-ready.ct.ts to ensure all tests are executed in the test suite.

@1307-Dev 1307-Dev marked this pull request as ready for review February 19, 2026 06:07
@nuke-ellington nuke-ellington added this to the 4.4.0 milestone Feb 23, 2026
@nuke-ellington nuke-ellington merged commit 3551db0 into siemens:main Feb 23, 2026
2 checks passed
@sonarqubecloud
Copy link

@github-actions github-actions bot mentioned this pull request Feb 23, 2026
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