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

[Bug]: When holding Shift to enable multi-selection, mouse:over and mouse:out do not behave as expected. #10337

Open
7 tasks done
zhe-he opened this issue Dec 12, 2024 · 6 comments
Labels

Comments

@zhe-he
Copy link
Contributor

zhe-he commented Dec 12, 2024

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have read and followed the Issue Tracker Guide
  • I have searched and referenced existing issues and discussions
  • I am filing a BUG report.
  • I have managed to reproduce the bug after upgrading to the latest version
  • I have created an accurate and minimal reproduction

Version

6.0.2

In What environments are you experiencing the problem?

No response

Node Version (if applicable)

None

Link To Reproduction

https://codepen.io/zhe-he-the-vuer/pen/ByBKXQN?editors=0010

Steps To Reproduce

  1. Create 3 rectangles: A, B, and C.
  2. Drag a selection box over rectangles B and C, ensuring the selection area just covers the right half of A.
  3. Hold Shift to prepare for selecting A

Expected Behavior

When the mouse enters the right half of A, hold Shift to trigger A's mouse:over. Release Shift to trigger A's mouse:out

2024-12-12.18.27.43.mov

Actual Behavior

When the mouse enters A's right area, holding Shift allows multi-selection of A but fails to trigger A's mouse:over event, which is a clear bug.

2024-12-12.18.14.27.mov

Error Message & Stack Trace

No response

@asturur asturur added the bug label Dec 26, 2024
@asturur
Copy link
Member

asturur commented Dec 26, 2024

I kind of agree is a bug, i could change idea when looking at the code to fix it.
I sincerly do not remember if there was a specific reason why it couldn't be that way

@asturur
Copy link
Member

asturur commented Dec 26, 2024

One of the reason why this could not be a bug is that you are hovering the active selection.
What you hovering is not what you are going to select
But AT LEAST the mouse:over event should tell you that you have both objects in sight.

@zhe-he
Copy link
Contributor Author

zhe-he commented Dec 27, 2024

One of the reason why this could not be a bug is that you are hovering the active selection. What you hovering is not what you are going to select But AT LEAST the mouse:over event should tell you that you have both objects in sight.

I made a minimal change to address this issue, ensuring it(mouse:over) will always return only one element to guarantee that the selected element being pressed and the element triggering the active border are the same.

@asturur
Copy link
Member

asturur commented Dec 27, 2024

I have seen that. I ll check it asap.

@asturur
Copy link
Member

asturur commented Dec 28, 2024

I have been staring at this issue hours, no joking.
I understand that this seems a good quick fix but there are issues with the api.

What is the role of findTarget?

findTarget is finding the target you are over with the cursor, exception made for that strange functionality of altSelectionKey that was made to avoid loosing the ability to reach the active object when preserveObjectStacking is true.

The logic of finding the object behind the activeSelection is already available inside handleMultiSelection.

I would rather run that logic every time there is an active selection, with or without selection key pressed, and return the information in the event, then the developer uses it as it may prefer. Let me make a counter proposal pr

@asturur
Copy link
Member

asturur commented Dec 28, 2024

#10365

this is an alternate solution

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

No branches or pull requests

2 participants