Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay on LeadingAction #27

Open
Mario8419 opened this issue Nov 9, 2022 · 5 comments · Fixed by #28
Open

Delay on LeadingAction #27

Mario8419 opened this issue Nov 9, 2022 · 5 comments · Fixed by #28

Comments

@Mario8419
Copy link

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

@marekrozmus
Copy link
Owner

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.

@Mario8419
Copy link
Author

exactly

@marekrozmus
Copy link
Owner

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

@Mario8419
Copy link
Author

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>
      )

@marekrozmus
Copy link
Owner

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

@marekrozmus marekrozmus reopened this Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants