Skip to content
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

Dragging blocks causes the blocks pane to change size #318

Closed
rschamp opened this issue Apr 20, 2017 · 3 comments · Fixed by #401
Closed

Dragging blocks causes the blocks pane to change size #318

rschamp opened this issue Apr 20, 2017 · 3 comments · Fixed by #401
Assignees
Labels
Milestone

Comments

@rschamp
Copy link
Contributor

rschamp commented Apr 20, 2017

Expected Behavior

Please describe what should happen
When I drag a block from the toolbox, nothing on the screen should move except for the block.

Actual Behavior

Describe what actually happens
When I drag a block from the toolbox, the right side of the page shifts ~20px to the left, slipping under the blocks pane.

Steps to Reproduce

Explain what someone needs to do in order to see what's described in Actual behavior above
Drag a block from the toolbox.

If you revert #263 the issue goes away, but I'm not sure what exactly introduced it, since that was so long ago. It seems to be related to the .injectionDiv toggling between overflow: hidden and visible on drags.

drag

Operating System and Browser

Chrome 57

@rschamp rschamp added the bug label Apr 20, 2017
@rschamp rschamp added this to the May 24 milestone Apr 20, 2017
@paulkaplan
Copy link
Contributor

So this is because we have been using the injectionDiv to contain the workspace (to do things like the rounded corner radius and correct borders). The problem with that is on drag, the injectionDiv gets set to overflow: visible to allow you to drag blocks outside the workspace (to anywhere on the page...) That functionality is intentional (see note in code https://github.com/LLK/scratch-blocks/blob/develop/core/block_drag_surface.js#L112-L117). If we want to maintain that functionality, we need to change the way we are styling the injectionDiv, because we can no longer use it as a clipping container.

Oh the jumping itself is caused by the overflow:visible causing a 1px increase in height causing the vertical scrollbar to appear.

@paulkaplan
Copy link
Contributor

One way to easily fix this is to just set overfloy-y: hidden on the body of the page. Since this is a sigle page app that never scrolls vertically, this probably would be fine. cc @lifeinchords ?

@rschamp
Copy link
Contributor Author

rschamp commented Apr 25, 2017

The only issue I see with that is that we would eventually want page scrolling similar to on 2.0, where you are alway able to scroll to the first row of sprites, even if your window is very short.

The long term fix sounds like reverting #263 and do the real fix for that in scratch-blocks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants