How to show confirmation modal before clearing all tags? #5813
-
I have tried adding customized component for ClearIndicator but either none click events worked, or it had it's default behaviour of isClearable (without showing modal) |
Beta Was this translation helpful? Give feedback.
Answered by
manjushsh
Nov 22, 2023
Replies: 1 comment 2 replies
-
Hi @jagodakubicka, After some tries, I was able to find out way to achieve this. Checkout 👉🏼 this code sandbox for working solution Here we are disabling clear event and manually calling that event once use clicks ok on popup/modal. Flow:
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
jagodakubicka
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @jagodakubicka, After some tries, I was able to find out way to achieve this.
Checkout 👉🏼 this code sandbox for working solution
Here we are disabling clear event and manually calling that event once use clicks ok on popup/modal.
I am not sure if it is a good practice or not.
Flow:
clearValue
from rest propsfunction ClearIndicator({ clearValue, ...props })
andonMouseDown, onTouchEnd
fromprops.innerProps
onClear
function withconst onClear = (e) => clearValue(e);