Skip to content

Commit 051841d

Browse files
committed
Fix react resizable class name
1 parent fc44bfe commit 051841d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

examples/1.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
background: #eee;
1111
}
1212
.box {
13-
position: relative;
1413
background: #ccc;
1514
border: 1px solid black;
1615
text-align: center;

lib/Resizable.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,16 @@ export default class Resizable extends React.Component {
9191

9292
render() {
9393
let p = this.props;
94+
let className = p.className ?
95+
`${p.className} react-resizable`:
96+
'react-resizable'
9497

9598
// What we're doing here is getting the child of this element, and cloning it with this element's props.
9699
// We are then defining its children as:
97100
// Its original children (resizable's child's children), and
98101
// A draggable handle.
99102
return cloneElement(p.children, assign({}, p, {
103+
className,
100104
children: [
101105
p.children.props.children,
102106
<DraggableCore

0 commit comments

Comments
 (0)