flutter-code-editor icon indicating copy to clipboard operation
flutter-code-editor copied to clipboard

Disable spell check in Firefox

Open alexeyinkin opened this issue 1 year ago • 5 comments

alexeyinkin avatar Mar 06 '23 13:03 alexeyinkin

See also:

  • https://github.com/flutter/flutter/issues/40682
  • https://github.com/flutter/flutter/issues/103342

Workarounds:

  1. spellCheckConfiguration: const SpellCheckConfiguration.disabled(), does not work.
  2. keyboardType: TextInputType.visiblePassword works but it requires platform check.

TODO:

  1. Investigate what exactly triggers spellcheck in Firefox because the minimal app does not. Describe it here.
  2. File a bug in Flutter.
  3. Make a workaround, likely with TextInputType.visiblePassword.

alexeyinkin avatar Mar 06 '23 13:03 alexeyinkin

As I checked, the reason behind spell check trigger is TextField.maxLines property. If it is set to something, even null, the FireFox will activate the spell check. As I see, there is no solution of removing some set property of the TextField.

I am going to implement the workaround first, and then send the defect to the flutter team.

yescorp avatar Mar 07 '23 05:03 yescorp

Setting keyboardType: TextInputType.visiblePassword breaks the TextField -> it becomes a single line.

I am investigating to find another workaround.

yescorp avatar Mar 07 '23 06:03 yescorp

The dummiest thing to do is to set autocomplete="false" with JavaScript on all textareas. This should be done in a timer every few seconds during the whole life of the app to guarantee it will not be cleared on rebuilds.

alexeyinkin avatar Mar 07 '23 07:03 alexeyinkin

I created the corresponding issue in Flutter repo

  • https://github.com/flutter/flutter/issues/122092

yescorp avatar Mar 07 '23 10:03 yescorp