Merge pull request #3115 from HeyPuter/puter-js-update260514-2
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled

PuterJS - Fix submenu behavior on mobile devices in Menubar web component
This commit is contained in:
Miika Kuisma
2026-05-14 11:45:47 +03:00
committed by GitHub
@@ -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();