mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-27 11:55:50 +00:00
Merge pull request #3115 from HeyPuter/puter-js-update260514-2
PuterJS - Fix submenu behavior on mobile devices in Menubar web component
This commit is contained in:
@@ -693,6 +693,10 @@ class PuterContextMenu extends PuterWebComponent {
|
||||
});
|
||||
|
||||
el.addEventListener('mouseleave', () => {
|
||||
// iOS Safari synthesizes mouseleave on touchend after a tap,
|
||||
// which would schedule the just-opened submenu to close.
|
||||
// On touch, submenus are driven by explicit taps, not hover.
|
||||
if ( this._isMobile() ) return;
|
||||
clearTimeout(this.#submenuTimeout);
|
||||
if ( el.dataset.hasSubmenu === 'true' && this.#activeSubmenu && this.#activeSubmenu.parentEl === el ) {
|
||||
this._scheduleSubmenuClose();
|
||||
|
||||
Reference in New Issue
Block a user