-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Blockly Developer Tools] Switching between tabs causes the workspace to be misaligned #5404
Comments
@BeksOmega I would like to contribute to this. Can I work on the issue with you? |
Sure thing @Apoorvgarg-creator ! I'm not actually working on this issue at the moment, but I'm happy to help in any way I can =) To get started you'll want to get set up for development if you haven't already. Then open up the block factory index.html file in your browser, and make sure you can reproduce the issue given the above steps. After that, you'll have do some debugging to figure out what the issue is, because I'm not exactly sure hehe. A good place to start is probably the onTab function, because that's what controls changing the what is shown and what is hidden. We would definitely love help with this bug, but it may not be the best starter issue (because I'm not even sure what's going on!) If you get stuck or bored and still want to contribute, feel free to pick up a different issue, like #5273 or #5374 And if you need help, always feel free to drop a message here! Best of luck :D |
@BeksOmega, Thank you for the guidance. |
@BeksOmega While I was debugging the problem. Screen.Recording.2021-08-24.at.8.40.47.AM.mov |
@BeksOmega, I guess the problematic function is AppController.prototype.onresize This function also creates problems in |
Wow nice find! That's a really weird behavior, because it only fixes the problem if you change the position of the console, not if you just resize it...
Oh sweet I'm glad you found something! I spent some time debugging, and I think there might be an issue with the workspace resizing before it is actually visible. But I'm not sure :/ |
@BeksOmega Can you tell me where to look for this? Maybe I could find something there. I have been trying to figure out the problem but on even making the changes some corner cases are creating the problem. |
I'm sorry man that sucks :/ If I were to try to debug this, I would probably add a breakpoint in the workspace's resize function to see if (a) it's getting called when it should be called, and (b) that it's updating everything it's supposed to correctly. But my instinct could be totally wrong, and that may not even be the problem :/ This is a really tricky issue! |
I added the breakpoints in the stated function, but it was running perfectly. I will keep those breakpoints and will try with other functions as well. |
A few observations about this issue...
I suspect the issue is in workspace_svg.setCachedParentSvgSize and blockly.svgResize. setCachedParentSvgSize will only update the width/height if they evaluate to true. If the width/height is zero, they evaluate to false, and the cache is not updated. So I suspect the sequence of events goes something like this...
I'm guessing that changing "if (width)" and "if (height)" in workspace_svg.setCachedParentSvgSize to "if (width != null)" and "if (width != null)" will fix this. |
Yes, I have observed the same while debugging the problem.
Thank you for the insight. I will add some breakpoints and try resolving the issue. Thank you @QuirkyCort. |
Describe the bug
If you switch back and forth between the Block Factory tab and the other tabs, then the other tabs, the workspaces will disappear. I think this is because they're becoming misaligned.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No disappearing.
Screenshots
Desktop (please complete the following information):
Additional context
Originally reported on the forums: https://groups.google.com/g/blockly/c/ys1bwF5WH6o/m/qG4IGBHHAQAJ
The text was updated successfully, but these errors were encountered: