flutter_html icon indicating copy to clipboard operation
flutter_html copied to clipboard

[BUG] iFrame prevents scrolling parent

Open mdalihusain opened this issue 5 years ago • 4 comments

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 avatar Oct 04 '21 16:10 mdalihusain

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.

tneotia avatar Oct 04 '21 19:10 tneotia

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 ?

mdalihusain avatar Oct 05 '21 04:10 mdalihusain

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 avatar Oct 05 '21 19:10 erickok

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

erickok avatar Nov 29 '21 09:11 erickok