-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
POC: use react portals for cell editors (#1369)
* POC: use react portals for cell editors * Delete obsolete tests * Fix selection/copy/drag masks positions on frozen columns * Simplify selectionMask position logic Remove unused props * Fix unit tests * Remove getSelectedRowTop * Fix unit tests * Fix unit tests in FF * Remove position prop in favor of left/top props * MInor cleanup * Remove fdescribe and fix unit tests * Remove empty event handlers * Add some comments * - Fix row heights for copy and drag masks - Add back dynamic row logic
- Loading branch information
1 parent
c2cfdf8
commit 264045f
Showing
25 changed files
with
299 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const editorRoot = document.body; | ||
|
||
export default class EditorPortal extends React.Component { | ||
static propTypes = { | ||
children: PropTypes.node | ||
}; | ||
|
||
el = document.createElement('div'); | ||
|
||
componentDidMount() { | ||
editorRoot.appendChild(this.el); | ||
} | ||
|
||
componentWillUnmount() { | ||
editorRoot.removeChild(this.el); | ||
} | ||
|
||
render() { | ||
return ReactDOM.createPortal( | ||
this.props.children, | ||
this.el, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.