Closed andreaslydemann closed 11 months ago
@dominicstop I have the same problem, any help on this?
Auxiliary view is completely un-pressable for me in v2.
Hey guys, we will look into this in the next week or so. We are working on a major rewrite so bear with us as we try to fix everything.
This should be fixed now. See the upgrade guide here: https://github.com/dominicstop/react-native-ios-context-menu/issues/77#issuecomment-1790890221
That's great, thanks @nandorojo and @dominicstop 👏
@nandorojo I'm using zeego, so I suppose that library needs a new release before this will work for me?
If you're using specific props on the auxiliary then yes. Otherwise you'll just need to upgrade this lib to v2.
I believe Zeego needs to upgrade for a few minor breaking changes. @dominicstop they're just changes on the auxiliary config right?
hi sorry for the late reply
i haven't made any changes yet to the props/types in v2 (almost everything has been on the native side)
the code for the aux. preview has been extracted and rewritten in a separate swift library called ContextMenuAuxiliaryPreview
— most of the changes are internal, but i did change how the transitions are configured
this what the new aux. preview config looks like in swift (it's mostly the same, i just needed to rename/move things around)
i'm planning on just making a function in the js-side that transforms the old config to the new one, so there won't be any breaking changes (hopefully haha)
and then combine the two configs together (e.g. type AuxiliaryPreviewConfig = AuxiliaryPreviewConfigDeprecated | AuxiliaryPreviewConfigNew
— this way, the new config will be optional to use haha
however, replacing the native aux. preview logic with the new one will take a bit of refactoring though, and ContextMenuAuxiliaryPreview
isn't complete yet (+ it hasn't gone through thorough testing, so it might be buggy)
When I use
renderPreview
to add a preview, my auxiliary view becomes unpressable. Buttons in the auxiliary view won't do anything besides closing down the context menu (as if I'm pressing the background directly).I have created an example below to reproduce the issue. The issue with pressing the auxiliary view is fixed as soon as you remove the renderPreview prop.
I looked around in the library, and think it has something to do with the logic around detaching the preview and auxiliary view from its parent view or creation of the touch handlers. At least in the ContextMenuView on line 359 you can set
shouldAutoDetachSubviews
tofalse
on theRNIWrapperView
for the preview. Then there is only the auxiliary view as a detached view, and it's pressable again. Maybe one view is blocking the other. Not sure if that knowledge is helpful.