-
Notifications
You must be signed in to change notification settings - Fork 151
Description
When typing in a markup section any spellcheck underlines will flicker on every character change which can be rather distracting. This is possibly related to #522 but I haven't noticed slowdown, just the flickering.
Examining other editors such as Medium, Dropbox Paper, and Quill, it would seem they do not suffer the same problem because they are not re-rendering when typing. Quill is the most well behaved out of the ones I looked at, both Medium and Paper flicker on Backspace, Medium also flickers on Space.
I had a look into how to re-use elements in editor-dom rather than re-rendering with new elements. I think there are a couple of issues that need to be resolved to get rid of the flickering:
- markup sections are always re-rendered
- when typing,
_joinSimilarMarkersmarks the existing Marker (and therefore TextNode) for deletion. Removal happens before the render which means it's not possible update the TextNode'snodeValuein the markup renderer but a completely new TextNode has to be generated and added to the parent Marker or MarkupSection
I'm happy to dig into this but I'm interested to hear if there are any recommended approaches.
QUESTIONS:
- this comment suggests that attributes on a markup section element may change, I could only see a way for the tag name or class name to be changed. Have I missed something?