Skip to content

Conversation

@akhatri-cmyk
Copy link
Contributor

The closeMenu() function was overwriting inputValue with stale state when called from selectOption(), causing displayed value to lag one selection behind.

Additionally, filterValue was not being cleared when closing without selecting, causing the filter to persist and hide options on subsequent opens.

Modified closeMenu() to accept shouldRestoreInput parameter to distinguish between:

  • Selection flow: Skip restoration (value already set correctly)
  • Cancellation flow: Restore to previous selected value and clear filter

Fixes #12146

What: Closes #

Additional issues:

The closeMenu() function was overwriting inputValue with stale state when
called from selectOption(), causing displayed value to lag one selection behind.

Additionally, filterValue was not being cleared when closing without selecting,
causing the filter to persist and hide options on subsequent opens.

Modified closeMenu() to accept shouldRestoreInput parameter to distinguish between:
- Selection flow: Skip restoration (value already set correctly)
- Cancellation flow: Restore to previous selected value and clear filter

Fixes patternfly#12146
@patternfly-build
Copy link
Collaborator

patternfly-build commented Nov 18, 2025

@nicolethoen nicolethoen requested a review from kmcfaul December 11, 2025 13:27
@nicolethoen nicolethoen merged commit d5053dd into patternfly:main Dec 11, 2025
13 checks passed
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 - TypeaheadSelect - displays value one selection behind

4 participants