downshift-js / downshift

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

Home Page:http://downshift-js.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to keep menu open on mobile for useComboBox when the keyboard closes

chadwtkns opened this issue · comments

  • downshift version: 8.2.2
  • node version: 8.19.4
  • npm (or yarn) version: 1.22.19 (Yarn)

Like the title says Im struggling with how to keep the menu open on a useComboBox if the keyboard closes in a mobile setting. I've only tested this in Safari on iOS but you can reproduce this in the first example in the documentation. So expected behavior would be even after clicking 'Done' that the comboBox stays open? How can I achieve this? Thank you.

Hi @chadwtkns! Not sure how what events are triggered (if any) when the iOS keyboard is closed.

useCombobox provides many ways to control the isOpen state prop, such as https://github.com/downshift-js/downshift/tree/master/src/hooks/useCombobox#statereducer, https://github.com/downshift-js/downshift/tree/master/src/hooks/useCombobox#defaultisopen or https://github.com/downshift-js/downshift/tree/master/src/hooks/useCombobox#isopen.

One of those options should work for you.