Skip to content

Commit 2fdd59e

Browse files
committed
Accept 'none' as an axis.
1 parent 0c2e0c8 commit 2fdd59e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,13 @@ handle: string,
110110
// If set to `true`, will allow dragging on non left-button clicks.
111111
allowAnyClick: boolean,
112112

113-
// Determines which axis the draggable can move. Accepted values:
113+
// Determines which axis the draggable can move. This only affects
114+
// flushing to the DOM. Callbacks will still include all values.
115+
// Accepted values:
114116
// - `both` allows movement horizontally and vertically (default).
115117
// - `x` limits movement to horizontal axis.
116118
// - `y` limits movement to vertical axis.
119+
// - 'none' stops all movement.
117120
axis: string,
118121

119122
// Specifies movement boundaries. Accepted values:

lib/Draggable.es6

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ export default class Draggable extends DraggableCore {
2020
/**
2121
* `axis` determines which axis the draggable can move.
2222
*
23+
* Note that all callbacks will still return data as normal. This only
24+
* controls flushing to the DOM.
25+
*
2326
* 'both' allows movement horizontally and vertically.
2427
* 'x' limits movement to horizontal axis.
2528
* 'y' limits movement to vertical axis.
29+
* 'none' limits all movement.
2630
*
2731
* Defaults to 'both'.
2832
*/
29-
axis: PropTypes.oneOf(['both', 'x', 'y']),
33+
axis: PropTypes.oneOf(['both', 'x', 'y', 'none']),
3034

3135
/**
3236
* `bounds` determines the range of movement available to the element.

0 commit comments

Comments
 (0)