Skip to content

Conversation

@lokanandaprabhu
Copy link
Member

Hey, I just made a Pull Request!

Fixes: https://issues.redhat.com/browse/RHDHBUGS-2506

Problem

When a user types a custom value in an ActiveMultiSelect widget (with ui:allowNewItems: true) and presses Enter, the Enter key event bubbles up to the form and triggers form submission, causing the form to advance to the next step.

Solution

  • Added freeSolo prop to Autocomplete when allowNewItems is enabled, allowing custom values
  • Added controlled inputValue with onInputChange handler for proper input state management
  • Added onKeyDown handler that intercepts the Enter key when there's typed input:
    • Calls event.preventDefault() and event.stopPropagation() to prevent form submission
    • Adds the typed value as a new chip
    • Clears the input field

----------BEFORE-----------

Screen.Recording.2026-01-15.at.3.53.32.PM.mov

----------AFTER------------

Screen.Recording.2026-01-15.at.3.54.10.PM.mov

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Jan 15, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets workspaces/orchestrator/plugins/orchestrator-form-widgets patch v1.6.0

@sonarqubecloud
Copy link

@lokanandaprabhu
Copy link
Member Author

/cc @mareklibra

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.

1 participant