SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.94k stars 1.23k forks source link

Right click fires other events #3973

Closed harelyshau closed 2 days ago

harelyshau commented 6 months ago

This is copy of this issue: https://github.com/SAP/openui5/issues/3936 as I didn't get any response there. Might be helpful to read it initially.

OpenUI5 version: latest (1.120.7)

Browser/version (+device/version): Chrome, Firefox, Safari (all on MacOS)

URL (minimal example if possible): https://harelyshau.dev/#/minesweeper (most priority for me) https://openui5.hana.ondemand.com/entity/sap.m.IconTabBar/sample/sap.m.sample.IconTabBar https://openui5.hana.ondemand.com/entity/sap.tnt.ToolHeader/sample/sap.tnt.sample.ToolHeaderIconTabHeader

Steps to reproduce the problem:

For custom button: 1) Go to this link: https://harelyshau.dev/#/minesweeper 2) Left click to any cell

image

3) Right click to any closed cell

image

4) Again right to cell which is clicked on step 3

image

As a result left click (press event) is also fired. But I think shouldn't be

For IconTab: 1) Click right button to one of the following controls: IconTabFilter (1st link) IconTabHeader (2nd link) I'm using right click and left click with pressed ctrl button (should be the same result, but might be different) 2) Left Click to empty space And you will see that time to time events like select or liveChange are triggered by this scenario Video link: https://1drv.ms/v/s!AhK9R225yn15a94Enfuo3KDccoI?e=VvVR2Q What is the expected result? Just open context menu without triggering extra events

What happens instead? Context menu is opened but with extra triggering of events

Any other information? (attach screenshot if possible) I've found that when I implemented custom button this way (just add one more event for handling right click). And I found that right click also triggers simple press event in button. I didn't expect that and tried with default button and there I wasn't be able to reproduce it and found other controls which have similar issue. Seems it's not all controls which have this behaviour but it's what I found quickly image

Video link: https://1drv.ms/v/s!AhK9R225yn15a94Enfuo3KDccoI?e=VvVR2Q

boghyon commented 6 months ago

The issue is not relevant to Windows users but seems to be only related to the macOS specific behavior that allows users opening the context menu with the control + left click combination: https://support.apple.com/guide/mac-help/right-click-mh35853/mac


@harelyshau

I found that right click also triggers simple press event in button.

I'm not able to reproduce the behavior neither with nor without the control key. Tried with the custom minesweeper button, Demo Kit sample button, and the plain HTML button on macOS.

Is the button issue still valid?

Other cases such as the IconTabBar can be still reproduced on macOS but only with the combination control + left click. Since there are other ways to open context menus, and since opening a context menu with the combination is a macOS-only feature, I wonder to which extend the described issue is really relevant to users of the affected controls.

harelyshau commented 6 months ago

Hi @boghyon Issue with my custom minesweeper button is still valid. It's reproduciable for me every time with control + left click or right click. Steps to reproduce it I provided above.

image image image
harelyshau commented 6 months ago

Regarding second part of your comment: Probably on Windows it might be possible with Shift+F10. I think it's not urgent defect for end user but still something what needs to be fixed with low priority. Some use case which I can imagine: If user made this right click with control button and checked the options and see that there is no something suitable (for ex for IconTabBar user might suggest that there should be option "open link in new tab") and he decided to close context window and select event is fired what might confuse.

harelyshau commented 6 months ago

Just interesting observation: The behaviour different in SAPUI5 and OpenUI5: It's reproducible for IconTabHeader with control + click for both frameworks, but for SAPUI5 it's reproducible with simple right click as well (probably it's not merge in SAPUI5 yet).

https://openui5.hana.ondemand.com https://sapui5.hana.ondemand.com

boghyon commented 6 months ago

Which macOS version are you testing with? Which options for the "Secondary click" are set in your system?

Without holding the Control key pressed, try with:


Probably on Windows it might be possible with Shift+F10

Just checked; not reproducible with Shift+F10 either.


for SAPUI5 it's reproducible with simple right click as well (probably it's not merge in SAPUI5 yet).

Yes, ui5.sap.com or sapui5.hana.ondemand.com currently responds with SAPUI5 1.120.6 (built at 03.02.2024 17:13:00). The change https://github.com/SAP/openui5/commit/ce99a79ce95af5eb60b0a04bf276bb6727d26cf3 is available since 1.121 so far.

harelyshau commented 6 months ago

hi @boghyon. I'm using macOS 14.1.1 with Google Chrome Version 122.0.6261.69 (Official Build) (arm64). Also reproducible for me in Safari, Edge, Firefox, Yandex browsers.

I'm using macbook touchpad only with ctrl + click or just right click from touchpad (in my settings it's pressing by two fingers at one time) to fire right click.

Probably soon I will be able to check on Windows as well. Then I let you know.

harelyshau commented 6 months ago

Yep, seems on Windows it's working fine with my custom button.

i556484 commented 5 months ago

Hello @harelyshau , Thank you for sharing this finding. I've created an internal incident DINC0089446. The status of the issue will be updated here in GitHub.

didip1000 commented 2 days ago

Hey @harelyshau,

The fix is available now on master (linked above) and will be coming to release version 1.129.

Thanks, Diana