UI: кнопка «Меню» надёжно открывается на мобильных (onClick вместо pointerup + touch-action)

Открытие бокового меню переведено на нативный onClick: на тач-устройствах
pointerup часто не приходит из-за pointercancel, из-за чего меню не открывалось.
Долгое удержание (10с → админка) оставлено на таймере и подавляет этот клик.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 17:48:08 +03:00
co-authored by Claude Opus 4.8
parent cec3aa25a6
commit 0745d07887
2 changed files with 11 additions and 4 deletions
+10 -4
View File
@@ -31,9 +31,14 @@ export function BottomBar({ onMenu }: { onMenu: () => void }) {
holdTimer.current = null;
}
};
const endHold = () => {
clearHold();
if (!holdFired.current) onMenu(); // обычный тап
// Открытие меню — на нативном onClick (надёжно на мобильных, в отличие от pointerup,
// который не приходит при pointercancel). Долгий зажим подавляет этот клик.
const onMenuClick = () => {
if (holdFired.current) {
holdFired.current = false;
return;
}
onMenu();
};
const onCreate = () => {
@@ -57,8 +62,9 @@ export function BottomBar({ onMenu }: { onMenu: () => void }) {
<button
className="slot"
aria-label="Меню"
onClick={onMenuClick}
onPointerDown={startHold}
onPointerUp={endHold}
onPointerUp={clearHold}
onPointerLeave={clearHold}
onPointerCancel={clearHold}
>
+1
View File
@@ -56,6 +56,7 @@
background: none;
border: none;
font-size: 12px;
touch-action: manipulation; /* без задержки/отмены тапа на мобильных */
}
.bottom-bar .slot .name { color: var(--text); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-bar .spacer { width: var(--fab-width); flex: 0 0 var(--fab-width); }