Replies: 1 comment
-
That's a good point. We should consider adding this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
🚀 Feature request
Add an extension point to control the initial focus behavior in the Select component, similar to the
autoFocus
property available in other Chakra UI components like Popover.🧱 Problem Statement / Justification
We are happy users of Chakra UI v2 and v3, and we love the transition from the native select box in v2 to the custom implementation in v3 has inspired our more design possibilities.
In our use case, we make use of the open property to control a select box. However, we encountered an issue where focus was automatically transferred to the component upon opening, which was not the desired behavior in our context. Upon investigation, we identified that the
setInitialFocus
function within the underlying zag-js library was responsible for this behavior, which could not be easily circumvented.✅ Proposed solution or API
Introduce an
autoFocus
property (or similar) to the Select component that allows developers to toggle the initial focus behavior.↩️ Alternatives
Combo boxes allow complex customizations. We considered working around the limitation of a select field by creating a combo box and destruct it, but this kludge is not very future proof.
📝 Additional Information
Beta Was this translation helpful? Give feedback.
All reactions