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

Commit 5531617

Browse files
flarniefacebook-github-bot
authored andcommitted
Quick fix for safari 'node not found' bug
Summary: This is a quick fix, but we will do a follow-up diff to add more precautions and fix any other misnamed refs. Want to push this asap to fix the bug. In a previous diff[1] we changed the syntax for getting the reference to the editor node, but this spot was not updated. [1]: https://our.intern.facebook.com/intern/diff/D5964582/ This introduced a bug where clicking a link caused the focus to move but the selection state was not cleared, and this is a known issue in Safari in particular. In the past we had a work-around in Draft, but the work-around was no longer working due to the misnamed ref. PS Thanks to @[578934877:sophiebits] for pairing with me and realizing the root cause of the bug. :) Reviewed By: sophiebits Differential Revision: D6344247 fbshipit-source-id: fb0c3f2a7264fc68319536d6c18c30a27053c0aa
1 parent c1150a7 commit 5531617

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/component/handlers/edit/editOnBlur.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function editOnBlur(editor: DraftEditor, e: SyntheticEvent<>): void {
3131
// opposed to clicking to another tab or window).
3232
if (getActiveElement() === document.body) {
3333
const selection = global.getSelection();
34-
const editorNode = editor.refs.editor;
34+
const editorNode = editor.editor;
3535
if (
3636
selection.rangeCount === 1 &&
3737
containsNode(editorNode, selection.anchorNode) &&

0 commit comments

Comments
 (0)