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

Commit

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

Summary:
Fixes #1085

Updated the comment describing the `onEditInput` event handler function.
Pull Request resolved: #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 85aa3a3 commit 14349f1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/component/handlers/edit/editOnInput.js
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 14349f1

Please sign in to comment.