Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support React v16 when editor is focused after removed from DOM
Summary: **Summary** - calling `Style.getScrollParent(editorNode)` with `null` will result in an uncaught error - `Ref#focus()` is often called within a `setTimeout` (even in some example IIRC). `Ref` doesn't get GCd, but the DOM node it points to may no longer exist. Since React v16 is so blazing fast, it's possible that we're trying to focus something that no longer exists. - Without this bit of code, we'd have to call `findDOMNode` on the ref before calling `focus`. That's not great since putting `findDOMNode` is discouraged in application code. Closes facebookarchive/draft-js#1409 Differential Revision: D5976879 fbshipit-source-id: f8f63525fdb6e76a111ea72edae1a620505f3e93
- Loading branch information