Skip to content

Commit 00396d1

Browse files
committed
fix: correct positioning of full-width draggable rows
1 parent 6850437 commit 00396d1

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

Diff for: examples/storybooks/__snapshots__/storyshots.test.js.snap

+10
Original file line numberDiff line numberDiff line change
@@ -3376,13 +3376,15 @@ exports[`Storyshots Basics Themes 1`] = `
33763376
"width": "100%",
33773377
}
33783378
}
3379+
treeId="rst__7"
33793380
>
33803381
<div
33813382
style={
33823383
Object {
33833384
"height": "100%",
33843385
}
33853386
}
3387+
treeId="rst__7"
33863388
>
33873389
<button
33883390
aria-label="Collapse"
@@ -3456,13 +3458,15 @@ exports[`Storyshots Basics Themes 1`] = `
34563458
"width": "100%",
34573459
}
34583460
}
3461+
treeId="rst__7"
34593462
>
34603463
<div
34613464
style={
34623465
Object {
34633466
"height": "100%",
34643467
}
34653468
}
3469+
treeId="rst__7"
34663470
>
34673471
<button
34683472
aria-label="Collapse"
@@ -3544,13 +3548,15 @@ exports[`Storyshots Basics Themes 1`] = `
35443548
"width": "100%",
35453549
}
35463550
}
3551+
treeId="rst__7"
35473552
>
35483553
<div
35493554
style={
35503555
Object {
35513556
"height": "100%",
35523557
}
35533558
}
3559+
treeId="rst__7"
35543560
>
35553561
<div
35563562
className="rstcustom__rowWrapper"
@@ -3637,13 +3643,15 @@ exports[`Storyshots Basics Themes 1`] = `
36373643
"width": "100%",
36383644
}
36393645
}
3646+
treeId="rst__7"
36403647
>
36413648
<div
36423649
style={
36433650
Object {
36443651
"height": "100%",
36453652
}
36463653
}
3654+
treeId="rst__7"
36473655
>
36483656
<div
36493657
className="rstcustom__rowWrapper"
@@ -3706,13 +3714,15 @@ exports[`Storyshots Basics Themes 1`] = `
37063714
"width": "100%",
37073715
}
37083716
}
3717+
treeId="rst__7"
37093718
>
37103719
<div
37113720
style={
37123721
Object {
37133722
"height": "100%",
37143723
}
37153724
}
3725+
treeId="rst__7"
37163726
>
37173727
<div
37183728
className="rstcustom__rowWrapper"

Diff for: src/node-renderer-default.js

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class NodeRendererDefault extends Component {
3838
className,
3939
style,
4040
didDrop,
41+
treeId,
4142
isOver, // Not needed, but preserved for other renderers
4243
parentNode, // Needed for dndManager
4344
...otherProps
@@ -209,6 +210,7 @@ NodeRendererDefault.propTypes = {
209210
PropTypes.oneOfType([PropTypes.string, PropTypes.number])
210211
).isRequired,
211212
treeIndex: PropTypes.number.isRequired,
213+
treeId: PropTypes.string.isRequired,
212214
isSearchMatch: PropTypes.bool,
213215
isSearchFocus: PropTypes.bool,
214216
canDrag: PropTypes.bool,

Diff for: src/react-sortable-tree.js

+1
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ class ReactSortableTree extends Component {
480480
scaffoldBlockPxWidth,
481481
node,
482482
path,
483+
treeId: this.treeId,
483484
};
484485

485486
return (

Diff for: src/tree-node.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class TreeNode extends Component {
1717
draggedNode,
1818
canDrop,
1919
treeIndex,
20+
treeId, // Delete from otherProps
2021
getPrevRow, // Delete from otherProps
2122
node, // Delete from otherProps
2223
path, // Delete from otherProps
@@ -150,6 +151,7 @@ TreeNode.defaultProps = {
150151

151152
TreeNode.propTypes = {
152153
treeIndex: PropTypes.number.isRequired,
154+
treeId: PropTypes.string.isRequired,
153155
swapFrom: PropTypes.number,
154156
swapDepth: PropTypes.number,
155157
swapLength: PropTypes.number,

0 commit comments

Comments
 (0)