Replies: 1 comment 2 replies
-
Love the detailed breakdown of your request. Makes it easier to chime in. There's no need to introduce a new property in this case. You can leverage the function onInteractOutside(event) {
const { target } = event.detail.originalEvent
if (!isHTMLElement(target)) return
if (target.closest("[data-part=tag]")) {
event.preventDefault
}
}, That goes into the machine like so: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
🚀 Feature request
In Combobox component, we want to exclude the specified DOM element from the dismissableElement.
This works well when combining TagsInput and Combobox.
🧱 Problem Statement / Justification
The combination with TagsInput is useful when building Combobox(multiple).
(I also know that there is an example in composition: https://github.com/chakra-ui/zag/blob/main/examples/next-ts/pages/composition/combo-tags.tsx )
At this time, we want to provide consistency in the behaviour of Combobox.
Specifically, we want to prevent the Combobox content from closing when a Tag's closeTrigger is clicked.
In other words, we want to prevent it from being dismissed.
current behavior is like below:
CleanShot.2024-06-14.at.10.07.18.mp4
CleanShot.2024-06-14.at.10.07.52.mp4
CleanShot.2024-06-14.at.10.08.27.mp4
✅ Proposed solution or API
Allowing the user to specify the exclude target DOM of the
trackDismissableElement
may solve this problem.For example, I am considering adding a context such as
excludeDismissableElements
and passing it to the exclude oftrackDismissableElement
.This would allow for preventing dismiss on certain elements in addition to the existing
input
,trigger
, andclearTrigger
.But I'm not sure if the idea is appropriate, so I'd like your opinion.
↩️ Alternatives
📝 Additional Information
Beta Was this translation helpful? Give feedback.
All reactions