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

Commit

Permalink
1/n Move 'blockSelect' flag out of cWU
Browse files Browse the repository at this point in the history
Summary: We have been slowly rolling out this change, and no significant new bugs have coincided with the roll-out. Let's remove the flag, so 100% of folks get this change. :)

Reviewed By: bvaughn

Differential Revision: D7415022

fbshipit-source-id: 831905c8caec5f34c54134d761644accbff03951
  • Loading branch information
flarnie authored and facebook-github-bot committed Mar 27, 2018
1 parent 1d77500 commit 0f6199d
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions src/component/base/DraftEditor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,18 @@ class UpdateDraftEditorFlags extends React.Component<{
*/
editor._latestEditorState = this.props.editorState;
}
if (gkx('draft_js_stop_blocking_select_events')) {
/**
* The reason we set this 'blockSelectEvents' flag is that IE will fire a
* 'selectionChange' event when we programmatically change the selection,
* meaning it would trigger a new select event while we are in the middle
* of updating.
* We found that the 'selection.addRange' was what triggered the stray
* selectionchange event in IE.
* To be clear - we have not been able to reproduce specific bugs related
* to this stray selection event, but have recorded logs that some
* conditions do cause it to get bumped into during editOnSelect.
*/
editor._blockSelectEvents = true;
}
/**
* The reason we set this 'blockSelectEvents' flag is that IE will fire a
* 'selectionChange' event when we programmatically change the selection,
* meaning it would trigger a new select event while we are in the middle
* of updating.
* We found that the 'selection.addRange' was what triggered the stray
* selectionchange event in IE.
* To be clear - we have not been able to reproduce specific bugs related
* to this stray selection event, but have recorded logs that some
* conditions do cause it to get bumped into during editOnSelect.
*/
editor._blockSelectEvents = true;
}
}

Expand Down Expand Up @@ -454,9 +452,6 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
* of browser interaction, not re-renders and forced selections.
*/
componentWillUpdate(nextProps: DraftEditorProps): void {
if (!gkx('draft_js_stop_blocking_select_events')) {
this._blockSelectEvents = true;
}
if (!gkx('draft_js_remove_componentwillupdate')) {
// we are using the GK to phase out setting this here
this._latestEditorState = nextProps.editorState;
Expand Down

0 comments on commit 0f6199d

Please sign in to comment.