question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fix spellcheck blinking as you type

See original GitHub issue

Do you want to request a feature or report a bug?

Bug.

What’s the current behavior?

One of the current issues with spellcheck is that when a node in the DOM is re-rendered, the browser seemingly takes a bit of time to update the spellcheck underlines, which cause a slight blink. So if you type a series of characters, with each character typed you’ll see the red spellcheck underlines blinking.

What’s the expected behavior?

To solve this for the 100% case is impossible, since it would mean never re-rendering. For example, selecting some text and add any mark to it will make the spellcheck underlines blink, but this transformation also isn’t something the browser can do by itself (often).

However, solving for the 99% case is attainable, because it would just mean that inserting individual characters (which is the majority of Slate changes in any real world use case) should update the DOM directly, instead of re-rendering via React.

I think this could be solved by adding an operation.isNative property, perhaps with a convenient change.asNative(c => { ... }) helper. This would allow us to create the same insert_text operations that we currently do, but flagged as “native” (eg. that they are already represented in the DOM) so that we can know that an individual <Leaf> does not need to re-render.

We’d need to also enforce that the <Editor> gets passed not only a value= property but also the previous operations= from a Change object if one exists. This way the current state has access to the previous operations to make the decision about whether to re-render.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
steobriencommented, Dec 14, 2018

Hey @ianstormtaylor, this is something we’d love to see fixed in Slate, and the pragmatic solution you hint at sounds exactly right. Any tips on where to get started with the implementation?

0reactions
bartzycommented, Feb 13, 2020

Hey @ianstormtaylor is this something that is planned to be fixed (via #3293 or otherwise)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

LO57409: V852 MOUSE CURSOR FOLLOWS TYPING ... - IBM
When typing in a memo using Notes 8.5.2 with Instant Spell check enabled, as you type the mouse will constantly hover and blink...
Read more >
How to eliminate the blinking spell check/suggestion popup ...
It will have different options. Click on the Spell-Checker . You can also use Ctrl + Alt + Shift + S as a...
Read more >
My blinking cursor has disappeared in Word
Someone else suggested, stop using spell checker as you type - did that and problem persists. Does anyone have any suggestion as to...
Read more >
Typing one letter at the beginning of a word will spellcheck the ...
One of the basic philosophies of every as-you-type spellchecker that I've used is that it doesn't flag words as you type them.
Read more >
How to get rid of blinking artifact/bug inside text input and ...
Applying spellcheck: false to my webPreferences inside my Electron preferences. I'm not sure what else it could be or how to fix it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found