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

Setting block property to 'movable: false' disables both shift-click select and context menu #2

Closed
rshaker opened this issue May 20, 2024 · 1 comment · Fixed by #3
Assignees
Labels
bug Something isn't working

Comments

@rshaker
Copy link
Owner

rshaker commented May 20, 2024

After using the block's custom context menu to 'Set unmovable', the block is no longer selectable via shift-click. The block may still be selected using the selection rectangle, but displays Blockly's stock context menu instead of the plugin's custom context menu.

image image image
@rshaker rshaker added the bug Something isn't working label May 20, 2024
@rshaker rshaker self-assigned this May 20, 2024
@rshaker
Copy link
Owner Author

rshaker commented May 30, 2024

There are two unrelated problems in play here.

1.) For shift-click: element.classList.contains("blocklyDraggable") is a bad assumption, because the now unmovable block is not draggable, so it loses the "blocklyDraggable" class.

2.) For context menu: Each block's "movable" property is being set/unset correctly. However playgroundState is not being saved to storage, nor is the playground's json preview of workspace contents being updated, until workspace background is clicked upon. Not sure I need to fix this, is it "expected playground behavior?"

@rshaker rshaker linked a pull request May 31, 2024 that will close this issue
rshaker added a commit that referenced this issue Jun 5, 2024
* Replaced blocklyDraggable check w/parent != blocklyBlockCanvas
* Added check for 'movable' before dragging selected block.

In the comments, I mention that drag logic may change in the future,
I couldn't decide if "drag everything depending on 'movable' setting
of block under the cursor" was a feature or bug.

Created /assets folder + added screenshots for README, and updated
explanation of package at top of README.

* Changed image url, gists are not allowed.

---------

Signed-off-by: Ron Shaker <rshaker@gmail.com>
@rshaker rshaker closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant