clicking outside combobox keeps focus on input, how can i get it to blur #3557
-
Hi, I'm currently trying out useCombobox and built this sandbox with a lot of help from the docs. I removed the restoreFocus prop from (in Popover.tsx) but it still restores focus to the input. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
UPDATE: See last few comments in this thread for the answer Just click a second time to blur it. This is how native controls work too. See Select https://codesandbox.io/s/solitary-microservice-7p2vvv the first click will close it and the second will blur the control. As for restoring, in a combobox, technically focus never left the input. It's virtually moving focus around in the popover. To verify this, try typing something in the input, then move up or down the menu in the popover using arrow keys. Note that the cursor remains in the input the entire time. |
Beta Was this translation helpful? Give feedback.
UPDATE: See last few comments in this thread for the answer
Just click a second time to blur it. This is how native controls work too. See Select https://codesandbox.io/s/solitary-microservice-7p2vvv the first click will close it and the second will blur the control.
As for restoring, in a combobox, technically focus never left the input. It's virtually moving focus around in the popover. To verify this, try typing something in the input, then move up or down the menu in the popover using arrow keys. Note that the cursor remains in the input the entire time.