Prevent group expansion arrow from activating group when expanding or collapsing#8785
Conversation
|
I like the basic idea, I'm just thinking if "instanceof StackPane" is determined enough to prevent other side effects (e.g. the hits badge is a StackPane too) |
|
Thank you for your review @calixtus. I agree that just The reason that Clickable area if only include Clickable area (red) if include both |
There was a problem hiding this comment.
Use pattern matching to avoid unnecessary casts
if (event.getTarget() instanceof StackPane pane) {
| // Prevent right-click to select group | ||
| event.consume(); | ||
| } else if (event.getTarget() instanceof StackPane pane) { | ||
| if (pane.getStyleClass().toString().equals("arrow") || pane.getStyleClass().toString().equals("tree-disclosure-node")) { |
There was a problem hiding this comment.
Maybe it's better to check for contains, because there could also be multiple style classes assigned.
There was a problem hiding this comment.
Thanks @calixtus , it has been updated with contains().
Really appreciate your review!
|
LGTM! Is this fix also for #3176 ? |
|
Hi @Siedlerchr , I believe that #3176 has also been fixed based on #7982 (comment) and #7982 (comment). |
|
Thanks again for your contributions! Superb so far! We really appreciate your engagement |
|
Hey @Siedlerchr @LIM0000 This fix/improvement has been reversed/broken by this commit: ...because the event is being intercepted and consumed, now via an EventHandler (bubbling phase) rather than capture phase, as was previous. So it's too late, the node has already been selected as before. E.g., row.addEventFilter(MouseEvent.MOUSE_PRESSED ...) is gone with the re-factor in the above link. |
|
Thanks for the hint. Feel free to create a PR with a fix
Cormac Redmond ***@***.***> schrieb am Mo., 24. Juli 2023,
02:03:
… Hey @Siedlerchr <https://github.com/Siedlerchr> @LIM0000
<https://github.com/LIM0000>
This fix/improvement has been reversed/broken by this commit:
bc662cb
<bc662cb>
...because the event is being intercepted and consumed, now via an
EventHandler (bubbling phase) rather than capture phase, as was previous.
So it's too late, the node has already been selected as before.
E.g., row.addEventFilter(MouseEvent.MOUSE_PRESSED ...) is gone with the
re-factor in the above link.
—
Reply to this email directly, view it on GitHub
<#8785 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACOFZBW7GCUA4JC3GLBTH3XRW3VRANCNFSM5VT4N6MQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…nt: JabRef#8785. Now, once again, the mouse click is handled and consumed at the capture stage if the expansion pane is licked, therefore preventing the node from being selected.
…nt: JabRef#8785. Now, once again, the mouse click is handled and consumed at the capture stage if the expansion pane is licked, therefore preventing the node from being selected.
|
@Siedlerchr, done: #10111 |


Previous discussion for group activation when expanding or collapsing group #7982
Proposal solution: Prevent group activation/select when user clicks on group expanding or collapsing arrow
Fixes: #7982
Fixes #3176
1.1.mp4
Further discussion
It might not be a good idea to only check eventTarget that returns StackPane class, as the group expand arrow is the only column that is using the StackPane class at current JabRef version. Any feedbacks are much appreciated!
PR Checklist:
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)