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

Spellcheck on Flutter Web #40682

Open
nturgut opened this issue Sep 17, 2019 · 20 comments
Open

Spellcheck on Flutter Web #40682

nturgut opened this issue Sep 17, 2019 · 20 comments
Labels
a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability customer: chilli customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team

Comments

@nturgut
Copy link
Contributor

nturgut commented Sep 17, 2019

Supporting spellcheck for text editing in Flutter Web Engine

@nturgut nturgut added a: text input Entering text in a text field or keyboard related problems platform-web Web applications specifically labels Sep 17, 2019
@nturgut nturgut added this to the September 2019 milestone Sep 17, 2019
@nturgut nturgut self-assigned this Sep 17, 2019
@nturgut nturgut added the c: new feature Nothing broken; request for a new capability label Sep 17, 2019
@nturgut
Copy link
Contributor Author

nturgut commented Sep 17, 2019

PR (as of today) will enable support for all browsers other than Safari Mobile: flutter/engine#12192

I am working on adding a fix for Safari Mobile as well.

@yjbanov yjbanov modified the milestones: September 2019, October 2019 Sep 26, 2019
@mdebbar mdebbar added this to To do in Flutter web - Text editing via automation Oct 1, 2019
@nturgut nturgut modified the milestones: October 2019, November 2019 Oct 28, 2019
@nturgut nturgut modified the milestones: November 2019, December 2019 Nov 27, 2019
@nturgut nturgut modified the milestones: December 2019, January 2020 Dec 21, 2019
@nturgut nturgut modified the milestones: January 2020, Near-term Goals Jan 15, 2020
@nturgut nturgut removed their assignment Jan 15, 2020
@kunit1
Copy link

kunit1 commented Mar 8, 2020

Is spellcheck supposed to be working for most browsers? I don't see the squiggly lines in a TextField in Chrome Desktop. Is the plan to add an option to enable spellcheck on a TextField?

@nturgut
Copy link
Contributor Author

nturgut commented Mar 9, 2020

@kunit1, the issue is still open. It is a todo on our list. Right now we are prioritizing autofill. I'll update this issue about spell check later. Please feel free to have a look at our project for text editing:
https://github.com/flutter/flutter/projects/57

@kf6gpe kf6gpe added the P1 High-priority issues at the top of the work list label May 29, 2020
@kf6gpe kf6gpe modified the milestone: Near-term Goals Jun 1, 2020
@yjbanov yjbanov added P2 Important issues not at the top of the work list and removed P1 High-priority issues at the top of the work list labels Jun 17, 2020
@iapicca iapicca added engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. labels Jul 3, 2020
@kf6gpe kf6gpe removed this from the [DEPRECATED] Near-term Goals milestone Jul 7, 2020
@darshankawar darshankawar added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label May 11, 2022
@CBBill
Copy link

CBBill commented Jun 14, 2022

Adding another voice to the chorus on this. Spellcheck is surprisingly important, as people have become dependent on it. Can anyone give us an idea of how deep in the backlog this is?

@creativecreatorormaybenot
Copy link
Contributor

@CBBill This issue has the P4 label, which means that it is a lower priority than all of the P0, P1, P2, and P3 issues.

@tsgregoryv
Copy link

I noticed that spell-check works in Firefox for Flutter Web apps. If you add this snippet as an include on your index.html, you can invoke the method during onChanged or similar in Flutter Web textfields. It should enable spell-check in Chrome on the active textfield. It isn't perfect, but it might serve as a good placeholder.

function enableSpellCheck() { document.activeElement.setAttribute('spellcheck','true'); }

@alexandersidum
Copy link

I noticed that spell-check works in Firefox for Flutter Web apps. If you add this snippet as an include on your index.html, you can invoke the method during onChanged or similar in Flutter Web textfields. It should enable spell-check in Chrome on the active textfield. It isn't perfect, but it might serve as a good placeholder.

function enableSpellCheck() { document.activeElement.setAttribute('spellcheck','true'); }

Thanks,
but is there any way to enable spellcheck to unfocused element also?

@davebound
Copy link

davebound commented Oct 5, 2022

I noticed that spell-check works in Firefox for Flutter Web apps. If you add this snippet as an include on your index.html, you can invoke the method during onChanged or similar in Flutter Web textfields. It should enable spell-check in Chrome on the active textfield. It isn't perfect, but it might serve as a good placeholder.

function enableSpellCheck() { document.activeElement.setAttribute('spellcheck','true'); }

Thanks. How to include this code in index.html and how to call from Flutter web Dart code please?

@tsgregoryv
Copy link

It would be possible to use the JS querySelector() or querySelectorAll() to find all text elements & call setAttribute(), but I don't think it would be reliable.

To include the JS code:

  1. Add the code in a separate .js file in the web folder of your project directory. Then modify index.html to reference/include it.
  2. Alternatively, you can modify the index.html file directly and embed the code between script tags.

It can be invoked through the dart:js library:

import 'dart:js' as js;
js.context.callMethod('enableSpellCheck');

Before you use it in production, ensure that you test it well. It is possible for the misspelling indicator to show up at an unexpected location with this method.

@serbixote
Copy link

I agree on this being higher priority than P4 🙏🏼

@ghost
Copy link

ghost commented Dec 31, 2022

@marco2704 Seconded. This is important to a wide variety of applications, and a large section of users are completely incapable of spelling without spellcheck. This should be at lease P3, to match the corresponding issue for android/iOS

@davidsomekh
Copy link

I am using flutter web, and this issue is my biggest concern right now. Spell check is something very basic!

@afandos-bbm
Copy link

any update on this?

@mdebbar
Copy link
Contributor

mdebbar commented Apr 10, 2023

I've looked into this a bit.

Enabling the browser spellcheck (to show the red squiggly line) is straightforward (here). But it requires a few other things in order to work well:

  1. Flutter's scroll position in the text field needs to be kept in sync with the <input> element (issue).
  2. Keep the <input> element alive and correctly positioned after the text field loses focus (to keep the squiggly lines visible).
  3. Re-verify that all styling information is kept in sync between Fltutter's text field and the <input> element (to make sure that Flutter's text and the <input>'s text are perfectly on top of each other).

This is yet another issue that would become trivial if implement this proposal.

@DavidOrakpo
Copy link

Any update on this issue please?

@pavlogrinchenkoo
Copy link

pavlogrinchenkoo commented Nov 8, 2023

@nturgut Hello! Is there any progress?

@frank42hh
Copy link

It's quite confusing that new features (for example autofill, 4 years ago) have a higher priority than fixing bugs.

@ws900
Copy link

ws900 commented Jul 4, 2024

@nturgut Hi!
How can we to elevate the priority level of this issue?
This is important because enable us to use Flutter on all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability customer: chilli customer: crowd Affects or could affect many people, though not necessarily a specific customer. engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team
Development

No branches or pull requests