Feature: Expose the CClickOutside component #401
Replies: 3 comments 1 reply
-
Hey @dombavetta thank you for opening this issue contribution. this is actually something I've been contemplating for a while now. I used the Furthermore the Personally, I would like to actually get rid of the Do you have any thoughts about whether or not to keep the |
Beta Was this translation helpful? Give feedback.
-
I didn't realize you already had a directive in there. Since that already exists I don't see a need to support both variants. Personally I would always opt to use a directive over the component. Here's a thought though.. I haven't looked into how the chakra webpack loader works, would it be able to resolve directive usage and auto import the directive? If not then I see a small benefit by maintaining the component variant as it could be auto imported. Even then I don't imagine either of these would be heavily used though so I'm not sure the cost/value of maintaining both is worth it. |
Beta Was this translation helpful? Give feedback.
-
To augment this thought, for the next version of Chakra UI Vue, we shall be exposing a |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
The
ClickOutside
component used by others components such asMenu
provides value when composing custom components. For example, I had to implement an autocomplete component with a results menu that dropped down and needed to utilize the click outside feature to close that menu when the user clicked away. As mentioned before, we have this available internally, I however had to write my own because it was not exposed.Describe the solution you'd like
Simply expose the
ClickOutside
component to be used by the public.Describe alternatives you've considered
This is currently implemented as a component that wraps other elements. I have implemented this in the past as a directive, this approach keeps the template a little cleaner by removing one level from the component hierarchy. I think offering both implementations would be beneficial. I can provide guidance or an example of a directive if needed.
Beta Was this translation helpful? Give feedback.
All reactions