Skip to content

fix: touch drag on mobile with inline touch-action - #16

Merged
MegaBlackLabel merged 2 commits into
mainfrom
fix/touch-drag-mobile
Jul 2, 2026
Merged

MegaBlackLabel merged 2 commits into
mainfrom
fix/touch-drag-mobile

Conversation

@MegaBlackLabel

Copy link
Copy Markdown
Owner

Summary

CSS-only touch-action: none on title bar may not reliably prevent mobile browser from
stealing touch events due to specificity or module scoping issues.

Fix

Added touch-action: none as an inline style on the TitleBar root div,
which has the highest CSS specificity and works across all browsers.

Test

Build + tests pass. Needs manual mobile verification.

Root cause

The "moves for a moment then stops" symptom is caused by the browser
firing pointercancel mid-drag because it doesn't recognize the
element as having touch-action: none due to CSS cascade issues.

…ile drag

CSS-only touch-action may not apply correctly on all mobile browsers
due to CSS module scoping or specificity conflicts. Adding it as an
inline style on the TitleBar root div ensures the browser recognizes
the element as non-scrollable during touch drag.
Copilot AI review requested due to automatic review settings July 2, 2026 13:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make mobile touch dragging of windows more reliable by enforcing touch-action: none on the TitleBar root via an inline style, preventing mobile browsers from canceling pointer events mid-drag.

Changes:

  • Added an inline style on the TitleBar root element to apply touchAction: 'none' while attempting to preserve any caller-provided style.

Comment thread src/components/window/TitleBar.tsx Outdated
Put touchAction: 'none' AFTER spread of rest.style so it cannot be
overridden by a caller passing touchAction in their style prop.
@MegaBlackLabel

Copy link
Copy Markdown
Owner Author

@copilot 修正しました。再レビューお願いします。

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown

@copilot 修正しました。再レビューお願いします。

確認しました。touchAction: 'none' が常に優先される形({ ...(rest.style as React.CSSProperties), touchAction: 'none' })になっており、指摘事項は解消されています。対象コミットは 1980a32 です。

@MegaBlackLabel
MegaBlackLabel merged commit 87d6d1b into main Jul 2, 2026
1 check passed
@MegaBlackLabel
MegaBlackLabel deleted the fix/touch-drag-mobile branch July 2, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants