-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Spellcheck on Flutter Web #40682
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
Comments
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. |
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? |
@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: |
Thanks, |
Thanks. How to include this code in index.html and how to call from Flutter web Dart code please? |
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:
It can be invoked through the dart:js library:
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. |
I agree on this being higher priority than P4 🙏🏼 |
@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 |
I am using flutter web, and this issue is my biggest concern right now. Spell check is something very basic! |
any update on this? |
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:
This is yet another issue that would become trivial if implement this proposal. |
Any update on this issue please? |
@nturgut Hello! Is there any progress? |
It's quite confusing that new features (for example autofill, 4 years ago) have a higher priority than fixing bugs. |
@nturgut Hi! |
if you don't want to call <script>
window.addEventListener("load", function (e) {
/// Since [spellCheckConfiguration:const SpellCheckConfiguration()] don't work on flutter web
/// this is to enable spellcheck for input elements when focused
document.addEventListener("focusin", function (event) {
// Check if the focused element is an input element
if (
event.target.tagName === "INPUT" ||
event.target.tagName === "TEXTAREA"
) {
event.target.setAttribute("spellcheck", "true");
}
});
});
</script> |
Amazingly this works quite well, except I see that the underline squiggles are way offset from the actual text. Any ideas why? |
@chipnetics i thougth the offset was a little bit, but turns out the offset is WAY FAR from the actual text, no updates from the flutter team to this' |
This doesn't work with semantics enabled :( |
Supporting spellcheck for text editing in Flutter Web Engine
The text was updated successfully, but these errors were encountered: