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
Remove leftover code in Combobox component (#1514)
* remove leftover code
This code existed before we had the option to make the first option the
"active" one.
This also contains a bug in the React code where pressing "ArrowDown" in
a closed Combobox opens the combobox and goes to the second item instead
of the first option.
* update changelog
Copy file name to clipboardExpand all lines: packages/@headlessui-react/src/components/combobox/combobox.tsx
-24Lines changed: 0 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -663,18 +663,6 @@ let Input = forwardRefWithAs(function Input<
663
663
},
664
664
[ComboboxState.Closed]: ()=>{
665
665
actions.openCombobox()
666
-
// TODO: We can't do this outside next frame because the options aren't rendered yet
667
-
// But doing this in next frame results in a flicker because the dom mutations are async here
668
-
// Basically:
669
-
// Sync -> no option list yet
670
-
// Next frame -> option list already rendered with selection -> dispatch -> next frame -> now we have the focus on the right element
671
-
672
-
// TODO: The spec here is underspecified. There's mention of skipping to the next item when autocomplete has suggested something but nothing regarding a non-autocomplete selection/value
// TODO: We can't do this outside next frame because the options aren't rendered yet
808
-
// But doing this in next frame results in a flicker because the dom mutations are async here
809
-
// Basically:
810
-
// Sync -> no option list yet
811
-
// Next frame -> option list already rendered with selection -> dispatch -> next frame -> now we have the focus on the right element
812
-
813
-
// TODO: The spec here is underspecified. There's mention of skipping to the next item when autocomplete has suggested something but nothing regarding a non-autocomplete selection/value
// TODO: We can't do this outside next frame because the options aren't rendered yet
549
-
// But doing this in next frame results in a flicker because the dom mutations are async here
550
-
// Basically:
551
-
// Sync -> no option list yet
552
-
// Next frame -> option list already rendered with selection -> dispatch -> next frame -> now we have the focus on the right element
553
-
554
-
// TODO: The spec here is underspecified. There's mention of skipping to the next item when autocomplete has suggested something but nothing regarding a non-autocomplete selection/value
0 commit comments