Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

TextEditorComponent - when updated synchronously, update even when hidden #17812

Closed

Conversation

maxbrunsfeld
Copy link
Contributor

@maxbrunsfeld maxbrunsfeld commented Aug 9, 2018

Atom's TextEditor objects normally update their DOM element asynchronously for performance reasons. They also use an IntersectionObserver to avoid unnecessary updates while they are not visible.

There is currently a setUpdatedSynchronously method that you can use to force text editors to always update immediately. Previously, even when editors were configured to update synchronously, they would not update unless visible. This PR causes text editors which have been set to update synchronously to update their DOM immediately even when hidden. I think that this is the behavior most users would want from the setUpdatedSynchronously method; it's typically a method that you call on a text editor when you need to interact with its DOM element programmatically and you don't want to the normal optimizations that prevent updates.

@maxbrunsfeld
Copy link
Contributor Author

This turned out not to be necessary.

@maxbrunsfeld maxbrunsfeld deleted the mb-update-synchronous-editors-when-hidden branch August 10, 2018 20:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant