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

Menubar, MegaMenu: Submenu doesn't open on mouseover, when using touchscreen notebook with mouse #15570

Closed
can-oezkan opened this issue May 15, 2024 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@can-oezkan
Copy link
Contributor

can-oezkan commented May 15, 2024

Describe the bug

When using a touchscreen notebook, the submenu's dont show on mouseover. You have to click the menu first.

I assume that this bug got introduced by this PR: #13447

The underlying issue seems to be this method, that gets called to determine if a mouseover should show the submenu or not:

public static isTouchDevice() {
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
}

Environment

angular business application

Reproducer

No response

Angular version

17.3.7

PrimeNG version

17.16.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v20.12.2

Browser(s)

No response

Steps to reproduce the behavior

  1. Use a notebook with touchscreen
  2. use the touchpad or external mouse to hover over menu

Expected behavior

The submenu should show on mouseover when using a touchpad or external mouse.

@can-oezkan can-oezkan added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 15, 2024
@DerekBolger
Copy link

DerekBolger commented Oct 23, 2024

Same Issue here tested using multiple variants of Microsoft Sufrace with external mouse and touchscreen enabled also Microsoft Surfacebook Laptops 3&4 with built in mousepad and touchscreen enabled.

Describe the bug

In past version of PrimeNG, submenus in Menubar Component were shown immediately when hovering over an item using a touch enabled device. In current version if we disable the touchscreen and the links work on hover > enable touchscreen and links don't show on hover.

touchscreen enabled

Environment

N/A

Reproducer

See below

Angular version

17.3.11

PrimeNG version

17.18.11

Build / Runtime

Angular CLI App

Language

TypeScript

Node version

18.18.2

Browser(s)

Chrome, Edge & Firefox

Steps to reproduce the behavior

Use PrimeNG's showcase for the Menubar: https://primeng.org/menubar utilising a touchscreen enabled device.

Behaviour

Hover over the Projects menu item and note that it's submenus do not show on hover on a device with touchscreen enabled, either using external mouse on Surfacebook or built in mousepad on Surface Laptop.

Screen.Recording.2024-10-23.123053.1.mp4

In the above video submenu opens on click but not hover when touchscreen is enabled.

Expected behavior

Submenus should appear when hovering over a menu item with Submenus.

There was a similar issue to this effecting the Tiered Menu https://primeng.org/tieredmenu that was fixed in this Pull Request in version 17.18.6 - #16077

onItemMouseEnter(event: any) {
if (!DomHandler.isTouchDevice()) {
if (this.autoDisplay) {
this.dirty = true;
}
if (this.dirty) {
this.onItemChange(event);
}

The above is similar to this code in menubar.ts

onItemMouseEnter(event: any) {
if (!DomHandler.isTouchDevice()) {
if (!this.mobileActive) {
this.onItemChange(event);
}
}

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation and try the latest PrimeNG version(v19). If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants