You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,3 +138,9 @@ Instructions:
138
138
139
139
We're excited and looking forward to seeing what you'll create!
140
140
Good luck 🚀
141
+
142
+
## Phase 2 tradeoffs and outcome
143
+
144
+
- Added an effect in `useAutocomplete` that resynchronizes the highlighted option whenever the filtered options array changes. This ensures late-arriving async options promote the correct `onHighlightChange` payload, at the cost of an extra highlight event when new data arrives.
145
+
- Considered recalculating the highlight during every reset or `syncHighlightedIndex` tick, but those approaches either missed async updates or ran more often than needed. The chosen solution isolates the work to actual option changes while reusing the existing keyboard/navigation logic.
146
+
- Introduced a regression test (`packages/material-ui/src/Autocomplete/Autocomplete.test.js`) that simulates the reported scenario—typing “1”, then “12”, then receiving updated options, to prevent the bug from resurfacing.
0 commit comments