flutter_issue_106664_workaround 0.1.3 copy "flutter_issue_106664_workaround: ^0.1.3" to clipboard
flutter_issue_106664_workaround: ^0.1.3 copied to clipboard

Fixes the Flutter issue of automatically scrolling to a focused iframe when clicking outside of such iframe

A workaround for Flutter Issue 106664 that locks the focus in iframe with TextField if used in web.

Usage #

Add this to your main.dart:

import 'package:flutter_issue_106664_workaround/flutter_issue_106664_workaround.dart';

void main() {
  FlutterIssue106664Workaround.instance.apply();
  // Continue your code.
}

The Workaround #

If not in web, do nothing.

If not in iframe, do nothing.

If Safari, do nothing because it is not affected.

If in Firefox, programmatically release focus on iframe's blur event. In Firefox it is sufficient. The downside is that selection is lost on clicking outside.

Otherwise programmatically release focus on iframe's mouseout event. In Chrome the solution for Firefox is insufficient. On the first outside click, it still scrolls back to the iframe, and only the second click is free to leave the iframe.

5
likes
140
pub points
9%
popularity

Publisher

verified publisherainkin.com

Fixes the Flutter issue of automatically scrolling to a focused iframe when clicking outside of such iframe

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT-0 (LICENSE)

Dependencies

flutter, web_browser_detect

More

Packages that depend on flutter_issue_106664_workaround