Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/component/handlers/edit/editOnInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ function onInputType(inputType: string, editorState: EditorState): EditorState {
}

/**
* This function is intended to handle spellcheck and autocorrect changes,
* This function serves two purposes
*
* 1. To update the editorState and call onChange method with the new
* editorState. This editorState is calculated in editOnBeforeInput but the
* onChange method is not called with the new state until this method does it.
* It is done to handle a specific case where certain character inputs might
* be replaced with something else. E.g. snippets ('rc' might be replaced
* with boilerplate code for react component). More information on the
* exact problem can be found here -
* https://github.com/facebook/draft-js/commit/07892ba479bd4dfc6afd1e0ed179aaf51cd138b1
*
* 2. intended to handle spellcheck and autocorrect changes,
* which occur in the DOM natively without any opportunity to observe or
* interpret the changes before they occur.
*
Expand Down