Skip to content

Commit 62a1215

Browse files
author
Kent C. Dodds
committed
Updating example to have appropriate cursors to provide the proper UX affordance.
1 parent 32184a5 commit 62a1215

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

example/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@
1212
margin: 0 50px;
1313
}
1414

15+
.react-draggable, .cursor {
16+
cursor: move;
17+
}
18+
.no-cursor {
19+
cursor: auto;
20+
}
21+
.cursor-y {
22+
cursor: ns-resize;
23+
}
24+
.cursor-x {
25+
cursor: ew-resize;
26+
}
27+
1528
.react-draggable strong {
1629
background: #ddd;
1730
border: 1px solid #999;
@@ -36,3 +49,5 @@
3649
</head>
3750
<body>
3851
<script src="../build/bundle.js"></script>
52+
</body>
53+
</html>

example/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ var App = React.createClass({
3434
<div className="box">I can be dragged anywhere</div>
3535
</Draggable>
3636
<Draggable axis="x" zIndex={100}>
37-
<div className="box">I can only be dragged horizonally</div>
37+
<div className="box cursor-x">I can only be dragged horizonally</div>
3838
</Draggable>
3939
<Draggable axis="y" zIndex={100}>
40-
<div className="box">I can only be dragged vertically</div>
40+
<div className="box cursor-y">I can only be dragged vertically</div>
4141
</Draggable>
4242
<Draggable onDrag={this.handleDrag} zIndex={100}>
4343
<div className="box">
@@ -46,14 +46,14 @@ var App = React.createClass({
4646
</div>
4747
</Draggable>
4848
<Draggable handle="strong" zIndex={100}>
49-
<div className="box">
50-
<strong>Drag here</strong>
49+
<div className="box no-cursor">
50+
<strong className="cursor">Drag here</strong>
5151
<div>You must click my handle to drag me</div>
5252
</div>
5353
</Draggable>
5454
<Draggable cancel="strong" zIndex={100}>
5555
<div className="box">
56-
<strong>Can't drag here</strong>
56+
<strong className="no-cursor">Can't drag here</strong>
5757
<div>Dragging here works</div>
5858
</div>
5959
</Draggable>

0 commit comments

Comments
 (0)