Skip to content

Commit

Permalink
updated function description for onEditInput event handler function (…
Browse files Browse the repository at this point in the history
…#2132)

Summary:
Fixes facebookarchive/draft-js#1085

Updated the comment describing the `onEditInput` event handler function.
Pull Request resolved: facebookarchive/draft-js#2132

Reviewed By: mitermayer

Differential Revision: D16545276

Pulled By: mrkev

fbshipit-source-id: 4f2f4263f9ee63d8c468f8f07ff0b30d9793fccb
  • Loading branch information
Mukesh Soni authored and facebook-github-bot committed Aug 22, 2019
1 parent a8e8fb0 commit b79bfa7
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit b79bfa7

Please sign in to comment.