Skip to content

fix(web): use Pointer Events API for touch support in HtmlElementContainer#2635

Open
omnisonic wants to merge 1 commit intoCoderLine:developfrom
omnisonic:feature/pointer-events-touch-support
Open

fix(web): use Pointer Events API for touch support in HtmlElementContainer#2635
omnisonic wants to merge 1 commit intoCoderLine:developfrom
omnisonic:feature/pointer-events-touch-support

Conversation

@omnisonic
Copy link
Copy Markdown

Issues

Fixes #2634

Proposed changes

Replace mousedown/mousemove/mouseup DOM event listeners with the Pointer Events API (pointerdown/pointermove/pointerup) in HtmlElementContainer.ts.

PointerEvent extends MouseEvent, so BrowserMouseEventArgs remains fully compatible — pageX, pageY, button, and preventDefault() all work identically. The change is backward compatible for existing mouse-based users.

Files changed:

  • packages/alphatab/src/platform/javascript/HtmlElementContainer.ts — swap event names
  • packages/alphatab/src/platform/javascript/BrowserMouseEventArgs.ts — update type annotation from MouseEventPointerEvent

Tested on:

  • Desktop mouse (existing behavior unchanged)
  • iPhone Safari — beatMouseDown, beatMouseMove, beatMouseUp all confirmed firing on touch
  • Lenovo Android tablet, Firefox 149 — all three events confirmed firing on touch

Checklist

  • I consent that this change becomes part of alphaTab under it's current or any future open source license
  • Changes are implemented
  • New tests were added — no browser event testing infrastructure exists in the current test suite; this is a DOM event wiring change that requires a real browser environment to test. All 1448 existing tests pass.

Further details

  • This is a breaking change
  • This change will require update of the documentation/website

…ainer

Replace mousedown/mousemove/mouseup DOM event listeners with
pointerdown/pointermove/pointerup in HtmlElementContainer. PointerEvent
extends MouseEvent so BrowserMouseEventArgs remains fully compatible.

Fixes CoderLine#2634

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@omnisonic omnisonic marked this pull request as ready for review April 4, 2026 02:36
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.

beatMouseDown/Move/Up events do not fire on touch devices (IContainer mouseDown/Move/Up documented as 'mouse/finger' but only handles mouse events)

1 participant