Skip to content

Migrate NumericInput slider to pointer events#500

Open
willeastcott wants to merge 1 commit intomainfrom
numeric-input-pointer-events
Open

Migrate NumericInput slider to pointer events#500
willeastcott wants to merge 1 commit intomainfrom
numeric-input-pointer-events

Conversation

@willeastcott
Copy link
Contributor

Summary

  • Replace mouse events (mousedown, mouseup, mousemove) with pointer events (pointerdown, pointerup, pointermove) for consistency with the Container component's resize handle
  • Add pointer ID tracking to prevent multi-touch interference
  • Works correctly even when pointer lock is unavailable or denied

Details

The NumericInput slider control now uses pointer events instead of mouse events, aligning with the pattern established in the Container component. Pointer ID tracking ensures only the pointer that initiated the drag can control or end it, making the component robust for multi-touch scenarios and browsers where pointer lock may not be supported.

The existing Pointer Lock API usage is preserved for infinite scrubbing functionality. Event constant names (EVENT_SLIDER_MOUSEDOWN, EVENT_SLIDER_MOUSEUP) are kept for backward compatibility.

Test plan

  • Verify slider drag works with mouse
  • Verify slider drag works with touch (if available)
  • Verify pointer lock still provides infinite scrubbing
  • Test in browser without pointer lock support (slider should still work)

- Replace mouse events with pointer events for consistency with Container

- Add pointer ID tracking to prevent multi-touch interference

- Works correctly even when pointer lock is unavailable
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.

1 participant