Skip to content

Commit fe3ba24

Browse files
committed
Add missing radix argument to parseInt
1 parent e37a1a8 commit fe3ba24

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/draggable.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,15 @@ module.exports = React.createClass({
398398

399399
// Snap to grid if prop has been provided
400400
if (Array.isArray(this.props.grid)) {
401-
var directionX = clientX < parseInt(this.state.clientX) ? -1 : 1;
402-
var directionY = clientY < parseInt(this.state.clientY) ? -1 : 1;
401+
var directionX = clientX < parseInt(this.state.clientX, 10) ? -1 : 1;
402+
var directionY = clientY < parseInt(this.state.clientY, 10) ? -1 : 1;
403403

404-
clientX = Math.abs(clientX - parseInt(this.state.clientX)) >= this.props.grid[0]
405-
? (parseInt(this.state.clientX) + (this.props.grid[0] * directionX))
404+
clientX = Math.abs(clientX - parseInt(this.state.clientX, 10)) >= this.props.grid[0]
405+
? (parseInt(this.state.clientX, 10) + (this.props.grid[0] * directionX))
406406
: this.state.clientX;
407407

408-
clientY = Math.abs(clientY - parseInt(this.state.clientY)) >= this.props.grid[1]
409-
? (parseInt(this.state.clientY) + (this.props.grid[1] * directionY))
408+
clientY = Math.abs(clientY - parseInt(this.state.clientY, 10)) >= this.props.grid[1]
409+
? (parseInt(this.state.clientY, 10) + (this.props.grid[1] * directionY))
410410
: this.state.clientY;
411411
}
412412

0 commit comments

Comments
 (0)