Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,14 @@ function createCSSTransform(style) {
// Replace unitless items with px
var x = style.x + 'px';
var y = style.y + 'px';
var out = {transform: 'translate(' + x + ',' + y + ')'};
var out = {transform: 'translate3d(' + x + ',' + y + ', 0px)'};
// Add single prefixed property as well
if (browserPrefix) {
out[browserPrefix + 'Transform'] = out.transform;
}
return out;
}


//
// End Helpers.
//
Expand Down
4 changes: 2 additions & 2 deletions specs/draggable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('react-draggable', function () {
expect(called).toEqual(true);
});

it('should render with translate()', function () {
it('should render with translate3d()', function () {
drag = TestUtils.renderIntoDocument(
<Draggable>
<div />
Expand All @@ -107,7 +107,7 @@ describe('react-draggable', function () {
TestUtils.Simulate.mouseUp(node);

var style = node.getAttribute('style');
expect(style.indexOf('transform: translate(100px, 100px);')).not.toEqual(-1);
expect(style.indexOf('transform: translate3d(100px, 100px, 0px);')).not.toEqual(-1);
});

it('should add and remove user-select styles', function () {
Expand Down