primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.39k stars 4.59k forks source link

Menubar with autoDisplay doesn't close submenu on mouseout #10728

Open Urtgard opened 3 years ago

Urtgard commented 3 years ago

[x] bug report => Search github for a similar issue or PR before submitting [ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap [ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) https://stackblitz.com/edit/primeng-menubar-demo-nfau6b?file=src%2Fapp%2Fapp.component.html

Current behavior When the cursor leaves a menuitem the submenu stays open and the css-class p-menuitem-active won't be removed.

Expected behavior Submenus shold be closed and p-menuitem-active should be removed.


If you disagree and think this is working as intended, please add an option to choose how the menubar should handle on mouseout.

yigitfindikli commented 3 years ago

Hi @Urtgard,

Menu components close when clicking events by design. So it's not a bug. I'm gonna mark it as a discussion. Let's hear the community.

daangeerdink commented 2 years ago

Agree with @Urtgard. It's strange that the active class remains while the cursor is not over the menuitem anymore. The same could be said about the submenu staying open.

The way I expect to see it is autoDisplay on true is hover-based, while on false it's click-based.

sutux commented 2 years ago

I agree with @daangeerdink. There are no words to add, he described it well.

johnfewell commented 2 years ago

Yes, please change this, it should at least be an option.

mertsincan commented 1 year ago

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. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

sutux commented 1 year ago

Hi,

unfortunately, this is still an issue. I tried it on Stackblitz with PrimeNG Version 14.2.1: https://stackblitz.com/edit/primeng-menubar-demo-cv9w8m?file=src/app/app.component.html

pete-mcwilliams commented 1 year ago

using this as a workaround

<p-tieredMenu #tieredMenu [model]="menuItems" [autoDisplay]="true" (mouseleave)="onMouseleave()"></p-tieredMenu>
  onMouseleave(){
    window.document.body.click();
  }
fabiosalat commented 8 months ago

using this as a workaround

<p-tieredMenu #tieredMenu [model]="menuItems" [autoDisplay]="true" (mouseleave)="onMouseleave()"></p-tieredMenu>
  onMouseleave(){
    window.document.body.click();
  }

this is perfectly working, thanks!

but... shouldn't autoHide property be doing the same thing? that's not working on Angular 17 for me

vpeter1119 commented 7 months ago

I was also expecting [autoHide]="true" to achieve this, but it doesn't seem to work in v16.9.1.

NathanRutilyDev commented 3 months ago

Here in July 2024 and still no implemented apparently ...