Skip to content

Commit

Permalink
docs(deprecations): remove old props
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Apr 29, 2017
1 parent ff67f9c commit bfc9374
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion README.md
Expand Up @@ -96,7 +96,6 @@ class App extends React.Element {
defaultPosition={{x: 0, y: 0}}
position={null}
grid={[25, 25]}
zIndex={100}
onStart={this.handleStart}
onDrag={this.handleDrag}
onStop={this.handleStop}>
Expand Down
8 changes: 4 additions & 4 deletions example/example.js
Expand Up @@ -67,7 +67,7 @@ var App = React.createClass({
<p>
<a href="https://github.com/mzabriskie/react-draggable/blob/master/example/index.html">Demo Source</a>
</p>
<Draggable zIndex={100} {...dragHandlers}>
<Draggable {...dragHandlers}>
<div className="box">I can be dragged anywhere</div>
</Draggable>
<Draggable axis="x" {...dragHandlers}>
Expand Down Expand Up @@ -103,7 +103,7 @@ var App = React.createClass({
<Draggable grid={[50, 50]} {...dragHandlers}>
<div className="box">I snap to a 50 x 50 grid</div>
</Draggable>
<Draggable bounds={{top: -100, left: -100, right: 100, bottom: 100}} zIndex={5} {...dragHandlers}>
<Draggable bounds={{top: -100, left: -100, right: 100, bottom: 100}} {...dragHandlers}>
<div className="box">I can only be moved 100px in any direction.</div>
</Draggable>
<div className="box" style={{height: '500px', width: '500px', position: 'relative', overflow: 'auto', padding: '0'}}>
Expand Down Expand Up @@ -137,7 +137,7 @@ var App = React.createClass({
{"I have a default position of {x: 25, y: 25}, so I'm slightly offset."}
</div>
</Draggable>
<Draggable zIndex={100} position={controlledPosition} {...dragHandlers} onDrag={this.onControlledDrag}>
<Draggable position={controlledPosition} {...dragHandlers} onDrag={this.onControlledDrag}>
<div className="box">
My position can be changed programmatically. <br />
I have a drag handler to sync state.
Expand All @@ -149,7 +149,7 @@ var App = React.createClass({
</p>
</div>
</Draggable>
<Draggable zIndex={100} position={controlledPosition} {...dragHandlers} onStop={this.onControlledDragStop}>
<Draggable position={controlledPosition} {...dragHandlers} onStop={this.onControlledDragStop}>
<div className="box">
My position can be changed programmatically. <br />
I have a dragStop handler to sync state.
Expand Down
7 changes: 2 additions & 5 deletions specs/draggable.spec.jsx
Expand Up @@ -42,7 +42,6 @@ describe('react-draggable', function () {
assert(drag.props.handle === null);
assert(drag.props.cancel === null);
assert(drag.props.bounds == false);
assert(isNaN(drag.props.zIndex) === true);
assert(typeof drag.props.onStart === 'function');
assert(typeof drag.props.onDrag === 'function');
assert(typeof drag.props.onStop === 'function');
Expand Down Expand Up @@ -115,7 +114,6 @@ describe('react-draggable', function () {
handle=".handle"
cancel=".cancel"
grid={[10, 10]}
zIndex={1000}
onStart={handleStart}
onDrag={handleDrag}
onStop={handleStop}>
Expand All @@ -130,7 +128,6 @@ describe('react-draggable', function () {
assert(drag.props.handle === '.handle');
assert(drag.props.cancel === '.cancel');
assert(_.isEqual(drag.props.grid, [10, 10]));
assert(drag.props.zIndex === 1000);
assert(drag.props.onStart === handleStart);
assert(drag.props.onDrag === handleDrag);
assert(drag.props.onStop === handleStop);
Expand Down Expand Up @@ -626,8 +623,8 @@ describe('react-draggable', function () {
assert(data.deltaY === 100);
}
drag = TestUtils.renderIntoDocument(
<Draggable onDrag={onDrag} style={{position: 'relative', top: '200px', left: '200px'}}>
<div />
<Draggable onDrag={onDrag} >
<div style={{position: 'relative', top: '200px', left: '200px'}} />
</Draggable>
);

Expand Down

0 comments on commit bfc9374

Please sign in to comment.