scratchfoundation / scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.
https://scratch.mit.edu/developers
Apache License 2.0
2.6k stars 1.39k forks source link

Horizontal playground: dragged block appears ~200 px to the left of cursor #870

Open msintov opened 7 years ago

msintov commented 7 years ago

Expected Behavior

Block should appear under cursor during drag.

Actual Behavior

Block appears about ~200px to the left of cursor during drag.

Steps to Reproduce

  1. Edit scratch-blocks/tests/horizontal_playground.html to turn off scrollbars: scrollbars: false,

  2. Open scratch-blocks/tests/horizontal playground html in browser

  3. Move toolbox to the bottom by selecting "Bottom" from dropdown

  4. Select a block with your mouse and drag it to the workspace

Actual results: block appears ~200px to the left of your cursor Expected results: block appears under cursor

Note: This issue appears to only affect the initial drag out from toolbox. After the initial drag out from the toolbox, the block DOES correctly appear under the cursor during the drag.

Operating System and Browser

Mac OS 10.11.6 Chrome 57

thisandagain commented 7 years ago

@rachel-fenichel Do you have any thoughts on this?

rachel-fenichel commented 7 years ago

Probably an issue in this function: https://github.com/LLK/scratch-blocks/blob/develop/core/flyout_horizontal.js#L389

rachel-fenichel commented 7 years ago

Is this with categories or with a simple toolbox?

msintov commented 7 years ago

Thanks for asking. It's with categories.

rachel-fenichel commented 7 years ago

Probably related: https://github.com/google/blockly/issues/728