Comments (4)
I think I found the issue; I can reproduce this in most browsers if I simply drag this thing fast enough out of the window.
This is the function for creating a transform:
function createCSSTransform(style) {
if (!style.x && !style.y) return {};
// Replace unitless items with px
var x = style.x + 'px';
var y = style.y + 'px';
return {
transform: 'translate(' + x + ',' + y + ')',
WebkitTransform: 'translate(' + x + ',' + y + ')',
OTransform: 'translate(' + x + ',' + y + ')',
msTransform: 'translate(' + x + ',' + y + ')',
MozTransform: 'translate(' + x + ',' + y + ')'
};
}
It seems that in some browsers, removing a translation completely causes the element to stay where it was last rendered, instead of being equal to translate(0,0)
.
One way to fix it is to remove the check on the first line. But I am not sure if this will affect other code. I will spend some more time with it.
from react-draggable.
You're right, that definitely fixes is the issue. Interesting. I was thinking it was mouse event related and that a solution similar to this would need to be implemented specific for SVG elements. Nice find.
from react-draggable.
This is in 0.7.4
.
from react-draggable.
Thank you!
from react-draggable.
Related Issues (20)
- The draggable container jumps to random positions HOT 1
- Switch to translate3d to handle bug in safari
- react 4.4.6版本 HOT 1
- 4.4.6版本 react HOT 7
- Draggable doesn't work with SVG elements as they are not an instance of HTMLElement interface but Element interface
- [email protected]: exports is not defined HOT 4
- Draggable Div Shifts when mousing over elements higher in heiarchy
- Critical 4.4.6 Bug: Module parse failed: Unexpected token (78:10) HOT 3
- Draggable doesn't recognize MouseEvent and dont work with Playwright
- Draggable does not work as intended in 4.4.6. (Normal operation in 4.4.5) HOT 1
- React draggable and react rnd issue HOT 1
- Inconsistent behavior on conditional render on mobile
- Partially out-of-view window jumps and changes position when handle is touched
- Missing peerDependency `@types/react`
- Strange "Ghost" Silhouette of Draggable Element When Using Non-integer (i.e., numbers with decimals)
- Collision detection
- CSS transition to come back smoothly
- console.js:273 Warning: findDOMNode is deprecated and will be removed in the next major release. HOT 5
- Bad paths after bundling with rollup following react 18 upgrade
- had dragged, how to update coverd area
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-draggable.