Skip to content

Conversation

@akhatri-cmyk
Copy link

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
Contributor

patternfly-build commented Nov 18, 2025

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

2 participants