Commit d5053dd
authored
fix(react-templates): fix TypeaheadSelect state synchronization issue (#12147)
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 #121461 parent cf8be69 commit d5053dd
File tree
1 file changed
+12
-5
lines changed- packages/react-templates/src/components/Select
1 file changed
+12
-5
lines changedLines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
207 | 214 | | |
| |||
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
226 | | - | |
| 233 | + | |
227 | 234 | | |
228 | 235 | | |
229 | 236 | | |
| |||
0 commit comments