🐛(react) fix closing of menu via toggle button
Previously it was not possible to close the menu when clicking on the toggle button on search select. It was caused by a conflicting state update. 1. Downshift triggers closing the menu from getToggleButtonProps 2. wrapperProps was calling downshiftReturn.openMenu()
This commit is contained in:
@@ -136,7 +136,7 @@ describe("<Select/>", () => {
|
||||
expectMenuToBeOpen(menu);
|
||||
expectOptions(["Paris", "Panama"]);
|
||||
|
||||
await user.type(input, "r");
|
||||
await user.type(input, "r", { skipClick: true });
|
||||
expectOptions(["Paris"]);
|
||||
|
||||
// Select option.
|
||||
@@ -211,7 +211,7 @@ describe("<Select/>", () => {
|
||||
expectMenuToBeOpen(menu);
|
||||
expectOptions(["Paris", "Panama"]);
|
||||
|
||||
await user.type(input, "rr");
|
||||
await user.type(input, "rr", { skipClick: true });
|
||||
expectNoOptions();
|
||||
|
||||
expect(input).toHaveValue("Parr");
|
||||
|
||||
Reference in New Issue
Block a user