Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-virtualized-sticky-tree",
"description": "A React component for efficiently rendering tree like structures with support for position: sticky",
"version": "3.0.0-beta12",
"version": "3.0.0-beta13",
"author": "Marc McIntyre <[email protected]>",
"license": "MIT",
"main": "lib/src/index.js",
Expand Down
17 changes: 12 additions & 5 deletions src/StickyTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ export interface StickyTreeProps<TNodeType extends TreeNode = TreeNode, TMeta =
*/
width: number;

/**
* if false, then the width and height are not set as inline styles on the sticky tree element.
*/
inlineWidthHeight?: boolean;

/**
* if true, the root node will be rendered (by calling rowRenderer() for the root id). Otherwise no root node will be rendered.
*/
Expand Down Expand Up @@ -930,11 +935,13 @@ export default class StickyTree<TNodeType extends TreeNode = TreeNode, TMeta = a

render() {
let style: React.CSSProperties = { overflow: 'auto', position: 'relative' };
if (this.props.width) {
style.width = this.props.width;
}
if (this.props.height) {
style.height = this.props.height;
if (this.props.inlineWidthHeight !== false) {
if (this.props.width) {
style.width = this.props.width;
}
if (this.props.height) {
style.height = this.props.height;
}
}

return (
Expand Down