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

Commit

Permalink
Flowify editOnBlur.js
Browse files Browse the repository at this point in the history
Summary: The only change I had to make was switching a sketchy null check to not be so, by wrapping the value in `Boolean`.

Reviewed By: kedromelon

Differential Revision: D16595682

fbshipit-source-id: eef3f62e14dd93f8e3a3149b8fa5959b4878fbe2
  • Loading branch information
mrkev authored and facebook-github-bot committed Aug 23, 2019
1 parent 14349f1 commit 6972278
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/component/handlers/edit/editOnBlur.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
* @flow strict-local
* @emails oncall+draft_js
*/

Expand All @@ -30,7 +30,7 @@ function editOnBlur(editor: DraftEditor, e: SyntheticEvent<>): void {
// However if users wish to override this behaviour they can provide
// a prop preserveSelectionOnBlur of `true`.
if (
!editor.props.preserveSelectionOnBlur &&
!Boolean(editor.props.preserveSelectionOnBlur) &&
getActiveElement() === document.body
) {
const selection = global.getSelection();
Expand Down

0 comments on commit 6972278

Please sign in to comment.