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

Fallback to last leaf node when inserting change #1359

Merged
merged 1 commit into from
Nov 1, 2017
Merged

Fallback to last leaf node when inserting change #1359

merged 1 commit into from
Nov 1, 2017

Conversation

blakeembrey
Copy link
Contributor

I swear I found the related issue before I discovered this issue and started working on fixing it, but I can't find it again now.

Before:

After:

@doodlewind
Copy link

Spellcheck/autocorrect is another pain point for now. Does this works for #909 ?

It seems to be hard since onInput fired after DOM is mutated, and onBeforeInput does not fire on spellcheck/autocorrect.

@blakeembrey
Copy link
Contributor Author

Unfortunately, no. But I'll look into it slowly as I get a grasp on how the codebase works. This only affects the changes that occur at the end of the line that would today crash the editor (because DOM offset is larger than leaf).

@ianstormtaylor
Copy link
Owner

If facebook/react#11211 was implemented, we'd actually have onBeforeInput fire in the case of spellcheck/autocorrect in modern browsers which would be nice!

@blakeembrey this looks great. Thank you!

@ianstormtaylor ianstormtaylor merged commit 6dc3c64 into ianstormtaylor:master Nov 1, 2017
@blakeembrey blakeembrey deleted the fix-input-eol branch November 1, 2017 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants