-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: round preview coordinates to avoid infinity updates #253
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Hi @jeetiss, I have seen this error many times for many different reasons. Do you have some test case that fails you can share with me? |
Hi @LouisBrunner! it is so hard to reproduce this error, i have logs for my previous reproduction, preview works fine and then for some reason it going mad and swaps Rounding is the lightest fix, do you think it should be fixed in some other way? |
Could you give me an example on how you use
When I test it on my side, it never jumps unless the mouse move, which is why I am confused. This issue used to happen a lot in the past but the current implementation of
This is a pretty error-prone part of the codebase. It's been responsible for many bugs in the past so I would like to understand what's going on before patching anything. For example, if the value is jumping back and forth then it's probably not due to a floating-point error and thus it could also happen on whole number (e.g. oscillating between 81 and 82) in which case rounding wouldn't fix it. |
preview is throw error
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops
when dragged object has float coordinates or dimensionsrounding solves this problem