This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove findDOMNode from DraftEditorBlockNode
Summary: This is part of DraftEditorContentsExperimental which is not actually rolled out anywhere. It's only used on some test pages for specific users: https://our.intern.facebook.com/intern/gatekeeper/projects/draft_tree_data_support/ I don't know if we have plans of actually rolling this out further. So I'll give it a benefit of a doubt that maybe we'll want to get back to it. We have to 100% get rid of findDOMNode uses in React though and this is technically reachable from Comet if the GK turns on. So I have to fix it or remove it. This diff fixes it by attaching a ref to the wrapper element created by blocks. However, if this is rendered in a parent a wrapper is not created. https://github.com/facebook/draft-js/blob/bafe30ab702c10b463fc7ee60bc2d6d9d4f7aef3/src/component/contents/exploration/DraftEditorBlockNode.react.js#L370 The non-experimental version uses a permanent wrapper div for this (D14716519): https://github.com/facebook/draft-js/blob/dceddf552006ea607bc5c15ce3d1b629eca1cb70/src/component/contents/DraftEditorBlock.react.js#L241 However, I'm not sure how you can even create a nested custom block and if scrolling is even relevant in that case. So my fix disables the auto-scrolling in that edge case. Seems good enough to me given that nobody is currently using this. I defer to the Draft.js team for a more permanent fix if we're rolling this out further. Reviewed By: gaearon Differential Revision: D19564783 fbshipit-source-id: f8250133334824f130a4214999a4768f39d49f4b
- Loading branch information