Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Preventing native text input events completely breaks autocorrect, autocomplete, auto-capitalization, predictive text, and double-space period insertion on iOS. In order to allow iOS to perform these kinds of operations, we have to avoid preventing the default event behavior and allow native input handling whenever possible.
This is mostly a reversion of the changes introduced in #1088, but I've tried to maintain the cleanup that was done in
packages/slate-react/src/plugins/core.js
'sonBeforeInput
method since then.That method also includes one additional difference, which is the use of
change.deleteCharBackward()
to avoid double input whenisNative
istrue
. Restoring the previously removedisNative
code throughout the codebase no longer seems to be enough to prevent rendering double input since focus-related state changes cause theisNative
state to get reset tofalse
before rendering happens. Deleting the inserted char seems like a bit of a hacky workaround to me, but it does work, and I wasn't able to come up with a better solution with my limited knowledge of the codebase. I'm open to suggestions.Fixes #1176
Fixes #1177