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: autoDisplay and autoHide broken #13512

Closed
g1thuser opened this issue Aug 18, 2023 · 10 comments
Closed

Menubar: autoDisplay and autoHide broken #13512

g1thuser opened this issue Aug 18, 2023 · 10 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@g1thuser
Copy link

g1thuser commented Aug 18, 2023

Describe the bug

The autoDisplay and autoHide properties don't work anymore. autoHide doesn't work at all, autoDisplay works only once after clicking on any root menu item. Clicking on a menu item leaves the last clicked root menu item in the selected status.

The error is already present in primeng 16.1.0, but didn't exist in primeng 16.0.2

Environment

Ubuntu 22.04
Firefox 116.03

Reproducer

No response

Angular version

16.2.0

PrimeNG version

16.2.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.5.1

Browser(s)

No response

Steps to reproduce the behavior

see here for primeng 16.1.0

see here for primeng 16.2.0

Expected behavior

see here for primeng 16.0.2

@g1thuser g1thuser added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 18, 2023
@SoyDiego
Copy link
Contributor

Hi @g1thuser, they know about the problem and will fix it.
Here you have a reply of one of the members of PrimeNG Team:

image

The link is this: #13455 (comment)

@AndreasHae
Copy link

AndreasHae commented Dec 28, 2023

Still causing issues on primeng 17.2.0.

Steps to reproduce:

  1. Add a p-menubar with [autoHide]="true" [autoHideDelay]="0" and submenus
  2. Hover over a root menu item -> submenu opens (works as intended because autoDisplay default is true)
  3. Hover away from menubar -> submenu should close immediately, but stays open

@chimayko
Copy link

chimayko commented Feb 6, 2024

Still happening on 17.5

Still causing issues on primeng 17.2.0.

Steps to reproduce:

  1. Add a p-menubar with [autoHide]="true" [autoHideDelay]="0" and submenus
  2. Hover over a root menu item -> submenu opens (works as intended because autoDisplay default is true)
  3. Hover away from menubar -> submenu should close immediately, but stays open

Still happening on 17.5, following the same steps described above.

Workaround:

Define a viewChild for the menu bar and add a mouseleave callback to it and force close, using renderer2:

this.renderer.listen(this.menubar.el.nativeElement, 'mouseleave', () => {
      this.menubar.hide();
    });

@kubedan
Copy link
Contributor

kubedan commented Apr 9, 2024

Autodisplay works if change source code.

--- a/src/app/components/tieredmenu/tieredmenu.ts
+++ b/src/app/components/tieredmenu/tieredmenu.ts
@@ -695,6 +695,9 @@
 
  onItemMouseEnter(event: any) {
     if (!DomHandler.isTouchDevice()) {
+      if (this.autoDisplay) {
+        this.dirty = true; 
+        }
       if (this.dirty) {
         this.onItemChange(event);
       }

@JeffersonFarFan
Copy link

JeffersonFarFan commented May 21, 2024

Are there any updates or workarounds for autoDisplay?
Neither default = true nor setting it to true works for me.

Still happening on 17.14.1

Found out that its not working only for chrome

@kubedan
Copy link
Contributor

kubedan commented May 22, 2024

Are there any updates or workarounds for autoDisplay? Neither default = true nor setting it to true works for me.

Still happening on 17.14.1

Found out that its not working only for chrome

You can do with the tieredmenu component what I did with the fileupload component (#15212 (comment)) and fix it as I mentioned here: #13512 (comment).

@JeffersonFarFan
Copy link

@kubedan Thanks for answer. So theres no solution without updating the primeng code ?

@kubedan
Copy link
Contributor

kubedan commented May 23, 2024

@kubedan Thanks for answer. So theres no solution without updating the primeng code ?

Unfortunately, I don't know of any other solution.

@bjsawyer
Copy link
Contributor

I've opened a PR based on @kubedan 's suggestion here #16077

@cetincakiroglu cetincakiroglu added this to the 17.18.7 milestone Jul 25, 2024
@mehmetcetin01140 mehmetcetin01140 added LTS-16-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 1, 2024
@mgafsia
Copy link

mgafsia commented Aug 19, 2024

Unfortunately, I still have the issue for autoDisplay and autohide. It still not work with v17.18.9. I'm using Chrome.

Any solution please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

10 participants