Skip to content

How to show confirmation modal before clearing all tags? #5813

Closed Answered by manjushsh
jagodakubicka asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  1. Extract clearValue from rest props function ClearIndicator({ clearValue, ...props }) and onMouseDown, onTouchEnd from props.innerProps
  2. Create a onClear function with const onClear = (e) => clearValue(e);
  3. Call it on modal button click

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jagodakubicka
Comment options

@manjushsh
Comment options

Answer selected by jagodakubicka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants