Open Ldoppea opened 1 year ago
I made some more investigations.
I applied this patch on the react-native-file-viewer extension : https://github.com/vinzscam/react-native-file-viewer/pull/111/files which convert the file-viewer into a modal (vs fullScreen).
When doing so, the interaction with the overlay is working correctly.
If I put fullScreen back, then the interaction doesn't work anymore.
navigationController.modalPresentationStyle = UIModalPresentationFullScreen;
So it seems related to having a fullscreen ViewController behind the Overlay.
I just stumbled upon the exact same problem, when I try to render a FullWindowOverlay on top of a fullScreenModal, the overlay renders correctly, but nothing inside it is interactable. @Ldoppea did you find a solution for this?
I found a solution for this. If anyone stumbles upon this issue in the future, try using touchables from react-native-gesture-handler instead of react-native, they seem to handle gestures better and all the buttons should work, regardless of what's behind the FullWindowOverlay!
Same here
I think this will work as a temporary solution. I had a slightly different problem with the portals. And I achieved the desired result by adding these lines
<Portal>
<FullWindowOverlay>
<GestureHandlerRootView style={{ flex: 1 }}>
{props.children}
</GestureHandlerRootView>
</FullWindowOverlay>
</Portal>
Specifically my problem was with the react-navigation presentation modal
just came across a somewhat similar issue, not sure if that's relevant to the original issue though, but just wanted to share an alternative solution without react-native-gesture-handler
.
I was trying to use FullWindowOverlay
for displaying a loading indicator over the stack navigators's modal (I think it's relevant for native Modal as well). My goal was to handle any touches on the top layer so they don't go down, but immediate Pressable
child of FullWindowOverlay
didn't want to handle touches at all, same as for some people above.
After some time spent on research, I realized that in the original example of FullWindowOverlay
there's an additional View
wrapper with pointerEvents="box-none"
:
And then in its turn there's a button inside it, which obviously works.
So I've added such wrapper and it fixed my issue. Hopefully this helps someone.
Description
Hi,
My project is using both react-native-screens and react-native-file-viewer
I need to be able to display an Overlay on top of the QuickLook View opened by react-native-file-viewer. So i'm using
<FullWindowOverlay>
.When doing so, my Overlay is correctly displayed on top of the QuickLook View. But some UI components does not react to touch inputs anymore:
<TextInput />
correctly works<Button />
is not touchable anymoreI created a reproduction repository. Here is what is displayed:
✅ The input text can be used. You can enter
a
in the keyboard to hide the screen.❌ If you click on the
Close the Overlay
button, nothing will happen.✅ But if you close the QuickLook first, then click on the button, the screen will be hidden.
I tried to implement this PR #1582 has it is about touch interaction. When doing so, the
hitTest
method correctly detect the clicked button. But nothing happens after that (onPress
callback is not called) (this modification is not included in my reproduction reprository)Do you understand why this happens?
Steps to reproduce
bug/react-native-screens-file-viewer
branch from the reproduction repositorydownload file
buttondownloadUrl
variable (if you don't trust the wikipedia source)open file viewer
button<FullWindowOverlay />
will open (I have to open it after the QuickLook View else it won't display on top of it)close the Overlay
button -> nothing happensa
it will close the overlay but don't do it yet)done
button from the QuickLook View (on top right) -> this close the file viewerclose the Overlay
button -> the overlay is closed correctlySnack or a link to a repository
https://github.com/Ldoppea/react-native-bug-reports/tree/bug/react-native-screens-file-viewer
Screens version
3.18.2
React Native version
0.66.4
Platforms
iOS
JavaScript runtime
None
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
iPhone 14
Acknowledgements
Yes