isClearable with custom click check outside the component useRef #5817
Unanswered
yuliya1223
asked this question in
Q&A
Replies: 1 comment
-
I encountered the same problem when clicking on the clear button closed the modal window where the select was located. Adding <div
onMouseDown={e => e.stopPropagation()}
onTouchStart={e => e.stopPropagation()}
>
<Select
isClearable
value={value}
onChange={onChange}
options={options}
/>
</div> |
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
-
Hi community,
I don't understand what's wrong in my code. when the user clicks on X (isClearable props) inside the select component to clear the list of selected values, then instead of clearing the values, my component simply collapses, because select thinks that the click is happening OUTSIDE the component. Although this element is inside the select. Please tell me how to fix this behavior? Example of my component
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions