Open Relie28 opened 9 months ago
I was able to fix the animation by patching the ContextMenueView.mm
with the contextMenuInteraction:previewForDismissingMenuWithConfiguration:
- (UITargetedPreview *)contextMenuInteraction:(UIContextMenuInteraction *)interaction previewForDismissingMenuWithConfiguration:(UIContextMenuConfiguration *)configuration API_AVAILABLE(ios(13.0)) {
UIPreviewTarget* previewTarget = [[UIPreviewTarget alloc] initWithContainer:self center:self.reactSubviews.firstObject.center];
UIPreviewParameters* previewParams = [[UIPreviewParameters alloc] init];
if (_previewBackgroundColor != nil) {
previewParams.backgroundColor = _previewBackgroundColor;
}
return [[UITargetedPreview alloc] initWithView:self.reactSubviews.firstObject
parameters:previewParams
target:previewTarget];
}
Before:
https://github.com/user-attachments/assets/ebd62997-1e42-420f-9946-da72149d5dd2
After:
https://github.com/user-attachments/assets/b7bb800e-f4f5-4f1f-a1b9-deb07e70899c
@mpiannucci I noticed that this method (along with contextMenuInteraction:previewForHighlightingMenuWithConfiguration:
which is already implemented in the library) is deprecated since iOS 17.0. It might be worth implementing the new methods instead:
Issue Description
I am encountering an issue with
react-native-context-menu-view
where the animation does not reset back to its original position after the context menu is dismissed. This issue is causing a significant visual glitch in my application.Steps to Reproduce
react-native-context-menu-view
in a component.Expected Behavior
The expected behavior is that after the context menu is dismissed, the animation should reset and return the component to its original position.
Actual Behavior
After dismissing the context menu, the animation remains in its final state and does not properly reset to the original position.
Visual example
https://github.com/mpiannucci/react-native-context-menu-view/assets/119743882/6fb45526-4431-4ff0-9162-bd269dd373b2
Here is a small example of what my code looks like.
Environment
react-native-context-menu-view
version: [^1.14.1]