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
First of all, thanks for the impressive component library! The headless architecture of Downshift make it easy and comfortable to make a combobox out from existing UI library with deep customization. I and our team made a reusable combobox component with Chakra UI v3 and Downshift as PoC, and the prototype1 is very concise.
However, there is a little problem that is hard to workaround: Chakra UI has an onInteractOutside mechanism (see its popover component) to manage popovers by maintaining a stack of layers. Downshift's useMouseAndTouchTracker handler, however, dispatches additional blur events alongside Chakra UI. We tried to block it in the reducer, but it is impossible to distinguish if a blur event is from the blur callback or from a regular InputBlur state change.
I can think of two approaches. One is to add an additional property to the blur callback, so that we can ignore the action coming from the blur callback. The other is to add an option to mask the blur callback completely. Either way makes Downshift's combobox more composable with UI libraries that implement that kind of mechanism themselves.
First of all, thanks for the impressive component library! The headless architecture of Downshift make it easy and comfortable to make a combobox out from existing UI library with deep customization. I and our team made a reusable combobox component with Chakra UI v3 and Downshift as PoC, and the prototype1 is very concise.
However, there is a little problem that is hard to workaround: Chakra UI has an
onInteractOutside
mechanism (see its popover component) to manage popovers by maintaining a stack of layers. Downshift'suseMouseAndTouchTracker
handler, however, dispatches additional blur events alongside Chakra UI. We tried to block it in the reducer, but it is impossible to distinguish if a blur event is from the blur callback or from a regularInputBlur
state change.I can think of two approaches. One is to add an additional property to the blur callback, so that we can ignore the action coming from the blur callback. The other is to add an option to mask the blur callback completely. Either way makes Downshift's combobox more composable with UI libraries that implement that kind of mechanism themselves.
Footnotes
My prototype: https://stackblitz.com/edit/chakra-downshift?file=src%2FApp.tsx. ↩
The text was updated successfully, but these errors were encountered: