react-swipeable-list icon indicating copy to clipboard operation
react-swipeable-list copied to clipboard

Delay on LeadingAction

Open Mario8419 opened this issue 2 years ago • 5 comments

I want to make a little icon animation before the Swipe back onClick but it disappears before and the destructiveCallbackDelay isn't working! Any workaround for this problem? thanks

Mario8419 avatar Nov 09 '22 05:11 Mario8419

Hi, do I understand correctly that you would like the swipe back animation to start after the icon's animation is ended? Now it starts to swipe back after click.

marekrozmus avatar Nov 10 '22 09:11 marekrozmus

exactly

Mario8419 avatar Nov 10 '22 09:11 Mario8419

@Mario8419 Added actionDelay parameter which will delay the animation and action triggering for specified time.

marekrozmus avatar Nov 13 '22 21:11 marekrozmus

thanks for adding actionDelay prop, but the problem is that the animation renders in SwipeAction and so it's the same effect like before.

const handleFavoriteCategorySwipe = (id, value) => (
      <LeadingActions>
         <SwipeAction
            onClick={() => updateCategoryFavorite(id, value )}
         >
            <span>
              {data.favorite ?
                  <FavoriteOnIcon /> 
                :
                  <img src={favoriteOffIcon} alt='Favorite-Off-Icon' /> 
              }
            </span>
          </SwipeAction>
        </LeadingActions>
      )

Mario8419 avatar Nov 14 '22 07:11 Mario8419

ok, my bad. Do I understand correctly then we should have separate delay for starting "return animation" and separate for triggering action?

marekrozmus avatar Nov 15 '22 17:11 marekrozmus