Skip to content

Fix <ReferenceInput> don't return currently selected choice when enableGetChoices returns false#10958

Merged
slax57 merged 1 commit intomasterfrom
fix-reference-input-controller-enable-choice-current-record
Sep 25, 2025
Merged

Fix <ReferenceInput> don't return currently selected choice when enableGetChoices returns false#10958
slax57 merged 1 commit intomasterfrom
fix-reference-input-controller-enable-choice-current-record

Conversation

@djhi
Copy link
Contributor

@djhi djhi commented Sep 24, 2025

Problem

When using the enableGetChoices prop of <ReferenceInput>, it won't return the currently selected record even though it was fetched.

Solution

  • Return the currently selected record if present.
  • Fix the existing test for enableGetChoices to also check the options passed to the ChoicesContext

How To Test

  • Story
  • It should display the current value (Leo Tolstoy)
  • Clicking on the dropdown button should show an empty list of choices until 4 characters are entered (for instance baud)

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@djhi djhi added the RFR Ready For Review label Sep 24, 2025
@slax57 slax57 self-requested a review September 25, 2025 08:21
@slax57 slax57 added this to the 5.11.4 milestone Sep 25, 2025
@slax57 slax57 merged commit 21d5221 into master Sep 25, 2025
15 checks passed
@slax57 slax57 deleted the fix-reference-input-controller-enable-choice-current-record branch September 25, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants