eclipse-sprotty/sprotty

Context Menu on Label/Button is not shown

BjBe82 opened this issue · 8 comments

Last working Version: 0.12.0
Bugged Version: 0.13.0

The context menu is no longer triggered (IContextMenuService is not called) if the user right-clicks a label (or button). For smaller nodes where the label covers most of the node, this makes it nearly impossible to open the context menu.

@BjBe82

Last working Version: 0.12.0
Bugged Version: 0.12.0

Do you mean "Bugged Version: 0.13.0"?

Probably caused by #316

Yes, I meant 0.13.0 -> update the ticket.

I checked now if the context menu is shown if the Label has the "selectFeature" feature. In this case, the context menu is triggered and shown.

The problem is that this has another side effect. If the label is selectable, the node will not be selected if you click on the label.

@BjBe82
I don't really understand the expected behavior looking into the current implementation. I'm about to create a reproducible example in one of our example projects to understand what and when should happen. But I think the isSelectable(target) is what prevents your app to show a context menu.
https://github.com/eclipse-sprotty/sprotty/blob/master/packages/sprotty/src/features/context-menu/mouse-listener.ts#L60

@BjBe82
You can try the current development state in the class diagram example here: https://gitpod.io/#https://github.com/eclipse-sprotty/sprotty/pull/346
Note that the node label itself is not selectable.

Feedback regarding the right-click selection behavior is very welcome here #346

Shall this be kept open, or is it fixed with #346?

@spoenemann
I think it is fixed now. Probably just forgot to close it

BjBe82 commented

Sorry for the late reply, I checked this with version 1.0.0 today and can confirm that it is fixed.