aheze / SwipeActions

Add customizable swipe actions to any view.
https://twitter.com/aheze0/status/1646399867764510721
MIT License
1.01k stars 41 forks source link

Wrapped view momentarily duplicated on a swipe when it has a .contextMenu modifier attached #5

Open bardigolriz opened 1 year ago

bardigolriz commented 1 year ago

When the control wrapped inside the SwipeView contains a .contextMenu modifier, swiping it will semi-occasionally momentarily result in a non-smooth duplication of the wrapped view:

RocketSim_Recording_iPhone_13_Pro_2023-04-15_10 39 01_pm

When I removed the contextMenu, it worked perfectly fine. I believe it is as simple as that, but if you need more information, please let me know.

aheze commented 1 year ago

Hmm yeah I think it's because contextMenu creates a snapshot of the view for the scale effect. Try setting swipeMinimumDistance to a lower value (starts the swipe gesture earlier):

.swipeMinimumDistance(0.5)
bardigolriz commented 1 year ago

Unfortunately this doesn’t help, also when reduced to an even lower value :( To be clear, it doesn’t appear to make any difference.