Skip to content
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

Black space appears when mobile keyboard is visible #47

Closed
navnis opened this issue Sep 10, 2021 · 13 comments
Closed

Black space appears when mobile keyboard is visible #47

navnis opened this issue Sep 10, 2021 · 13 comments

Comments

@navnis
Copy link

navnis commented Sep 10, 2021

If we will try to pull the sheet upwards forcefully Black space appears when the mobile keyboard is visible. Black space is visible just above the keyboard.

Browser(Android)- Chrome(92.0.4515.159)
Browser(iOS)- Safari
react-model-sheet (v1.4.1)

In iOS
IMG_2338

In Android
Screenshot_2021-09-10-13-41-07-648_com android chrome

@navnis navnis changed the title Black place appears when is mobile keyboard visible Black space appears when is mobile keyboard visible Sep 10, 2021
@navnis navnis changed the title Black space appears when is mobile keyboard visible Black space appears when in mobile keyboard visible Sep 10, 2021
@navnis navnis changed the title Black space appears when in mobile keyboard visible Black space appears when mobile keyboard is visible Sep 10, 2021
@Temzasse
Copy link
Owner

Hi @navnis👋

This doesn't seem to be happening in the example app (at least on my iPhone) so it's a bit difficult to tell what is happening on your end.

Default keyboard:

image

SwiftKey keyboard:

image

Can you provide a reproduction eg. in CodeSandbox?

@navnis
Copy link
Author

navnis commented Sep 13, 2021

Hey @Temzasse

You can go to Teasit
And then you can follow the steps from the videos that I have attached to recreate that scenario...

Android

Screenrecording_20210913_172926.mp4
Screenrecording_20210913_174739.mp4

iOS

sheetlow.mp4

@navnis
Copy link
Author

navnis commented Sep 13, 2021

Hey @Temzasse

In your example app also this issue persists...
I have attached the video...

scenario - I tried to scroll on the right side of the sheet...

OS - iOS
Browser - Safari

2021-09-13.at.8.49.49.PM.mp4

@alex-cory
Copy link

alex-cory commented Sep 13, 2021

This is also happening in the example app for me.

bug.modal.sheet.mp4

@Temzasse
Copy link
Owner

I have quite limited amount of time to work on this lib at the moment so it would be amazing if someone could help me out by figuring out the reason for this issue and then create a PR 😄

I think the most likely cause for these scrolling related issues has something to do with body scroll locking. Framer Motion should automatically lock body scrolling for any gestures that are applied to draggable elements but clearly it's not working 100% robustly in all cases.

@shivamragnar
Copy link

Hey @Temzasse was there any updates on this one? I tried debugging this but not yet found a way around this.

@Temzasse
Copy link
Owner

@shivamragnar unfortunately I don't have the bandwidth to investigate issues like this which are not easily reproducible 😞 I could not reproduce this when I initially tried to debug it so it is very difficult to fix something you can't reproduce.

@shivamragnar
Copy link

@Temzasse It's alright, but it can be easily seen in the example app specifically in Slack Message example in iOS Safari.

@niklasgrewe
Copy link

i think you need to set a min-height: 100vh to the html element.

@atlasbc
Copy link

atlasbc commented Jun 23, 2022

This issue is probably caused by y value being smaller than 0. Since y value makes transform: translateY(y), being it smaller than 0 makes action sheet container float. Could it be solved by restricting minimum y value to 0? @Temzasse. y value becomes smaller than 0 because window.height changes when screen keyboard pops up.

@Temzasse
Copy link
Owner

Temzasse commented Oct 7, 2022

@atlasbc good suggestion about restricting the minimum value for y to be 0 👍🏻 I'll investigate how this can be done with Framer Motion.

@Temzasse
Copy link
Owner

Temzasse commented Oct 7, 2022

Restricting the y value didn't help. It seems that this is a "feature" in iOS Safari and not really a bug in the library: https://stackoverflow.com/questions/56351216/ios-safari-unwanted-scroll-when-keyboard-is-opened-and-body-scroll-is-disabled

@Temzasse
Copy link
Owner

Temzasse commented Oct 7, 2022

Using a better body scroll locking implementation from React Aria (usePreventScroll) seems to mitigate this issue. I also added the y value restriction just to be safe. Hopefully this is now fixed in v1.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants