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

[BUG] iFrame prevents scrolling parent #854

Closed
mdalihusain opened this issue Oct 4, 2021 · 4 comments
Closed

[BUG] iFrame prevents scrolling parent #854

mdalihusain opened this issue Oct 4, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@mdalihusain
Copy link

mdalihusain commented Oct 4, 2021

Describe the bug:
When an iframe is rendered, we are unable to scroll the parent if touching the iframe. We have to scroll from the side padding to scroll the parent.
Opening this issue as requested by @erickok in #299

HTML to reproduce the issue:
<h3>YouTube iframe:</h3> <iframe src="https://google.com"></iframe> <h3>Google iframe:</h3> <iframe src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>

Html widget configuration:
Html( data: """ <h3>YouTube iframe:</h3> <iframe src="https://google.com"></iframe> <h3>Google iframe:</h3> <iframe src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe> """, // data: dumContent, onLinkTap: (link, a, b, c) { launch(link); }, style: { "body": Style( padding: EdgeInsets.symmetric( horizontal: 10), fontSize: FontSize( _fontSize, ), fontFamily: languageCode == "en" ? GoogleFonts.karla().fontFamily : GoogleFonts.rhodiumLibre() .fontFamily, color: Theme.of(context) .textTheme .caption .color, fontWeight: FontWeight.w600, margin: EdgeInsets.symmetric(vertical: 0), wordSpacing: 3), "span": Style( padding: EdgeInsets.symmetric( horizontal: 10), fontSize: FontSize( _fontSize, ), fontFamily: languageCode == "en" ? GoogleFonts.karla().fontFamily : GoogleFonts.rhodiumLibre() .fontFamily, color: Theme.of(context) .textTheme .caption .color, fontWeight: FontWeight.w600, margin: EdgeInsets.symmetric(vertical: 0), wordSpacing: 3), "p": Style( fontSize: FontSize( _fontSize, ), fontFamily: languageCode == "en" ? GoogleFonts.karla().fontFamily : GoogleFonts.rhodiumLibre() .fontFamily, color: Theme.of(context) .textTheme .caption .color, fontWeight: FontWeight.w400, margin: EdgeInsets.symmetric(vertical: 0), ), }, )

Expected behavior:
We don't want scrolling inside the iframe, but we want when someone swipes over the iframe the parent should scroll.

Device details and Flutter/Dart/flutter_html versions:
App is live on play store and all devices are facing this issue.
I am testing on Redmi Note 8 Pro - Android 11.
flutter_html - 2.1.4
Flutter - 2.2.3

@mdalihusain mdalihusain added the bug Something isn't working label Oct 4, 2021
@tneotia
Copy link
Collaborator

tneotia commented Oct 4, 2021

Unfortunately we cannot fix this bug, it is due to how android widgets are embedded in the Flutter view. This has been a long standing issue with webviews in Flutter, so we would need to wait for an official fix from their side.

@mdalihusain
Copy link
Author

Unfortunately we cannot fix this bug, it is due to how android widgets are embedded in the Flutter view. This has been a long standing issue with webviews in Flutter, so we would need to wait for an official fix from their side.

Then how come in #318 it is said that this issue is fixed ?

@erickok
Copy link
Collaborator

erickok commented Oct 5, 2021

Actually it sounds you want the opposite of #318 which fixed that scrolling in the iframe should be possible. You want the opposite.Maybe a custom rendere with IgnorePointer would work but like @tneotia says there are somelimitations to what Flutter can do here.

@erickok
Copy link
Collaborator

erickok commented Nov 29, 2021

Closing as we are limited here to what Flutter can do.

@erickok erickok closed this as completed Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants