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

Brakes scroll of parent, only ios #155

Open
AttilaBarany opened this issue May 15, 2024 · 6 comments
Open

Brakes scroll of parent, only ios #155

AttilaBarany opened this issue May 15, 2024 · 6 comments
Assignees
Labels
good first issue Good for newcomers wait external fix External library fix is needed

Comments

@AttilaBarany
Copy link

Hi. Any chance to fix this issue? Some webviews needed to be displayed in a regular scrollable column in my project. Or do I miss maybe a setting which can fix this issue?
On Android I can scroll down the column easily even if I drag the webview, but not on iOS. It scrolls only if I drag outside the webview. Which is not possible eg if the webview is higher than the screen height. Then every other content of the column after the webview will be unreachable:(. I also tried overflow hidden on the webpage, did not help. Also set webViewState.webSettings.iOSWebSettings.scrollEnabled = false for a try, but it just changed the scrollablity of the html content inside the webview. In normal case in swiftui and wkwebview works together smoothly.

To reproduce:
Screenshot 2024-05-15 at 12 21 31

@KevinnZou
Copy link
Owner

@AttilaBarany The issue is related to nested scrolling and is not a problem with this library. You can refer to this reply and try to implement nestedscroll functionality.

@KevinnZou KevinnZou self-assigned this May 16, 2024
@KevinnZou KevinnZou added the good first issue Good for newcomers label May 16, 2024
@AttilaBarany
Copy link
Author

@KevinnZou Thanks for the fast reply. The problem is just the opposite. Yes, nestedscroll did have problems in compose with Androidview, where parent steels the scroll event, we can read a lot about it on stackoverflow too. But here, the child (webview) steels all the events from the parent on ios. I tried to add ondrag, customnestedscroll etc... to the webview directly, and does not trigger anything on ios. I could not get a single println of them. The event stucks somewhere inside the lib. So actually this looks a library problem on ios platform. This is a big limitation that on iOS you can not use it, just with full screen, where no other components needed to display.

@KevinnZou
Copy link
Owner

@AttilaBarany Thanks for your information! I do not have time to check it deeply currently. But I think nestscroll modifier should solve your issue. You just need to intercept the scroll of webview first and then check whether webview can scroll. If it cannot, then pass the scroll event to the parent. I would recommend you check this lib. Could you please provide the code for the custom nested scroll?

@AttilaBarany
Copy link
Author

@KevinnZou Thanks, but I was digging deeper, and found out, the problem happens with every UIKitView (I beleive you use that one too for ios wkwebview), even with just a single UIView(). So I filed a ticket at compose multiplatform. It is such a basic functionality, and I think the whole UIKitView thing worth nothing without having them in scrollable views. Btw Flutter was suffering from the same thing before, I dont know if still do.
You can follow the issue if interested, they are saying they know about it, and trying to resolve:
JetBrains/compose-multiplatform#4818
I think you can close this ticket, or maybe need some adjustment later once they find a solution for the original problem.
Thanks!:)

@KevinnZou KevinnZou added documentation Improvements or additions to documentation wait external fix External library fix is needed and removed documentation Improvements or additions to documentation labels May 17, 2024
@CMingTseng
Copy link

@KevinnZou Thanks, but I was digging deeper, and found out, the problem happens with every UIKitView (I beleive you use that one too for ios wkwebview), even with just a single UIView(). So I filed a ticket at compose multiplatform. It is such a basic functionality, and I think the whole UIKitView thing worth nothing without having them in scrollable views. Btw Flutter was suffering from the same thing before, I dont know if still do. You can follow the issue if interested, they are saying they know about it, and trying to resolve: JetBrains/compose-multiplatform#4818 I think you can close this ticket, or maybe need some adjustment later once they find a solution for the original problem. Thanks!:)
@AttilaBarany

Hello Senior Developer,

I found this project because I need WebView and Adjust, and I read through various issues here. I noticed that you are using WebView and Adjust on iOS. I have been having configuration issues with this part myself. This is my project: https://github.com/cybernhl/webapp

Could you please guide me on how to configure it?

Thank you.

@AttilaBarany
Copy link
Author

AttilaBarany commented Jul 9, 2024

@KevinnZou Thanks, but I was digging deeper, and found out, the problem happens with every UIKitView (I beleive you use that one too for ios wkwebview), even with just a single UIView(). So I filed a ticket at compose multiplatform. It is such a basic functionality, and I think the whole UIKitView thing worth nothing without having them in scrollable views. Btw Flutter was suffering from the same thing before, I dont know if still do. You can follow the issue if interested, they are saying they know about it, and trying to resolve: JetBrains/compose-multiplatform#4818 I think you can close this ticket, or maybe need some adjustment later once they find a solution for the original problem. Thanks!:)
@AttilaBarany

Hello Senior Developer,

I found this project because I need WebView and Adjust, and I read through various issues here. I noticed that you are using WebView and Adjust on iOS. I have been having configuration issues with this part myself. This is my project: https://github.com/cybernhl/webapp

Could you please guide me on how to configure it?

Thank you.

There is no multiplatform solution for this yet. It is waiting for compose multiplatform to handle UIKitviews properly in scrollables. This issue is flagged to be "waiting external solution". Only workaround is to build your screen or page entirely in SwiftUI/UIKit, and make an if in compose. If the platform is iOS then load the whole page in UIKitView, so you can have native iOS scrollview embedding WKWebview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers wait external fix External library fix is needed
Projects
None yet
Development

No branches or pull requests

3 participants