-
Notifications
You must be signed in to change notification settings - Fork 139
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
Interactive elements beneath overlay are not "blocked" in iOS #180
Comments
Sadly, this issue renders this package completely unusable for us. Is this still being maintained? |
Facing the same issue. This is such a great library, but this issue is something that needs to be addressed for our implementation. I am hopeful that this will get resolved soon. |
@stipsan Please see if this can be addressed. Or if we need to handle onDismiss in a different way. |
@matt-joecoffee
For the overlay to look and work as the library, I just copied the overlay CSS from the library and updated a few styles. Specifically the opacity prop. I added transition and it looks and works almost similar. Added that CSS here for reference.
|
Hi, here is our workaround to the issue.
|
Does anyone understand why this is happening? I don't understand why the tap is going through the backdrop... And mobile Safari seems to be the only browser behaving like this. Safari desktop works fine. |
After some investigation I found the root of the problem: The Reach UI portal that contains the bottom sheet needs to have the full height. So by adding this CSS globally the problem is fixed: reach-portal {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
} I can't guarantee that this will not break other things though, but so far everything looks good. |
@signorbusi thanks, that worked great for me! I just had to update it to have a For me- // Hack for https://github.com/stipsan/react-spring-bottom-sheet/issues/180#issuecomment-1144537142
reach-portal {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 100;
} Nasty iOS Safari bug :/ |
Just an update. one of the drawbacks of this method is the page will not be interactable for clicking for about a second after closed. Kinda annoying :/ Looking for a better solution. |
I have faced with same issue. When I click on the backdrop div it propagates the event and causes unintended click on other components. I mix the solutions above and put some logic into it. Here is my way:
(Pay attention to css by the way, especially sibling's css) I don't know if it breaks something, if it is then forgive me :D Here is my react component
Here is my css
|
thank you, I just fixed it by hiding the orjinal backdrop. |
Here is my simple solution that worked with me just fine. I just added a sibling, and set the 'blocking' to be false. function MyBottomSheetModal(props: BottomSheetProps) {
return (
<BottomSheet
sibling={
<div
data-rsbs-backdrop="true"
onClick={(e) => {
e.stopPropagation();
e.preventDefault();
props.onDismiss?.();
}}
/>
}
blocking={false}
{...props}
/>
);
} |
Hi,
Great little library. I really love the bottom sheet. However, I'm seeing an issue in Safari on iOS, where clicking the overlay to close the bottom sheet is not being stopPropagated. Any interactive element under the overlay is triggered instead.
In your Basic example, you can see this by tapping the overlay atop the Open button to close the bottom sheet. It closes and immediately reopens the sheet, because the Open button is also being tapped. So, really easy to observe the issue. Hopefully also easy to fix.
The text was updated successfully, but these errors were encountered: