-
Notifications
You must be signed in to change notification settings - Fork 13
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
v0.1.3 #6
v0.1.3 #6
Conversation
83d9f93
to
be8043d
Compare
No problem! It looks the Readme still mentions using a patched version of the library, but I'm think that's no longer the case, since your PR was merged into DragSelect. |
Signed-off-by: Hollow Man <[email protected]>
Ah Okay, has fixed this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some testing and all seem fine. I noticed a small nit, which is that in a newly refreshed/reloaded workspace the very first time I shift-click a child block it only selects the child. Once I click away, from that point on when I shift-click a child block it selects the child and the top-level ancestor block.
Hi, thanks for testing! Actually I can't reproduce what you mentioned. In a newly refreshed/reloaded workspace the very first time I shift-click a child block it only selects the child, then when I click away, from that point on when I shift-click that child block again, it will still select that child block only. Maybe I have misunderstood what you said, it would be great if you can post some gifs to help me know. |
@mark-friedman I'm also not seeing the behavior as described. So far things seem to be working well for me. |
@HollowMan6 @ewpatton Note that after the reload my first click is the shift-click of the multi-select.mov |
Okay, I see. Unfortunately, I cannot come up with an instant fix for this because this relates to the fundamental of how this plugin works, and I would say that the bug was not introduced by this PR and should exist since the first beginning. Currently, we rely on DragSelect to know which block gets selected. DragSelect seems to listen to the "blocks". However, it actually works by listening to the SVG path element, which is always a rectangle with some transparent parts forming a block. For such irregularly shaped blocks in your example, the two blocks' SVG path elements overlap with each other, so if you shift-click on that area, DragSelect will think that both blocks get selected. I would say a proper fix should be that Blockly implements some sort of "native version of DragSelect" and exposes it with an API, so that we can know for sure where the block actually locates, and that would be a lot of work. If such an API is available, we can then use that API instead of DragSelect. |
Any idea why it works one way in a freshly loaded workspace and another way after click activity in the background? |
In a freshly loaded workspace, your focus is not on the workspace until you click on some part of it. The plugin cannot receive the keyboard event when your focus is not on the workspace, so the shift drag didn't actually get activated at that time (You can see that the icon in the right-bottom corner also suggests this). The first click on a freshly loaded workspace would always be the Blockly native one that selects only one block if you happen to click on some block, and that matches the typically expected behaviour as you will not select more blocks in a freshly loaded workspace. |
It's possible we could attach the key handler to the document, or some other developer provided element.
…Sent from my iPhone
On Nov 15, 2022, at 17:05, Hollow Man ***@***.***> wrote:
Any idea why it works one way in a freshly loaded workspace and another way after click activity in the background?
In a freshly loaded workspace, your focus is not on the workspace until you click on some part of it. The plugin cannot receive the keyboard event when your focus is not on the workspace, so the shift drag didn't actually get activated at that time (You can see that the icon in the right-bottom corner also suggests this). The first click on a freshly loaded workspace would always be the Blockly native one that selects only one block if you happen to click on some block, and that matches the typically expected behaviour as you will not select more blocks in a freshly loaded workspace.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
I remember we discussed this issue before in the summer, as there can be multiple workspaces with multiple instances of plugins on one page. We can't just simply listen to the document. After all, the behavior is expected, and I think this should not be a problem to keep as it is. |
That supports my position that it could be developer provided as the developer knows more about their end product than we do. We might also be able at least in app inventor to focus the workspace to address this issue if that's the limitation. It ought to be as easy as recommending in the readme that people call .focus() on the workspace but I have tried that yet.
…Sent from my iPhone
On Nov 15, 2022, at 17:11, Hollow Man ***@***.***> wrote:
It's possible we could attach the key handler to the document, or some other developer provided element.
I remember we discussed this issue before in the summer, as there can be multiple workspaces with multiple instances of plugins on one page. We can't just simply listen to the document.
After all, the behavior is expected, and I think this should not be a problem to keep as it is.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Yeah, I agree with the later part, we can call .focus() to get workspace selected in the first place, and just added that together with the issue discussed above into the README. I've also added the .focus() into the test, now it should not be a limitation any more when running the Blockly Playground via npm start. For the former part, I think it's not necessary, it may complex the plugin by requiring more parameters. There may also exist some hidden issues if we implement that. |
Signed-off-by: Hollow Man <[email protected]>
Signed-off-by: Hollow Man <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to approve this for now and we should file an issue to look into the DragSelect with invisible rectangles thing. I think it's solveable if we play with the event handling a bit since a child block is contained within its parent in the SVG, so we can always just pick the node deepest in the DOM tree.
Has filed an issue here: ThibaultJanBeyer/DragSelect#150 |
is3dSupported
is removed, so now makeBlockly.WorkspaceSvg.getBlockDragSurface
always returnnull
to disable dragsurface: fix: stop usingis3dSupported
google/blockly#6400Signed-off-by: Hollow Man [email protected]