RepeatMousedownMixin

Generates mousedown events at intervals for as long as the mouse is down

Overview

Purpose: Generates mousedown events at intervals for as long as the mouse is down.

This mixin works at the beginning of the Elix render pipeline:

eventsmethods → setState → render DOM → post-render

Provides the component with:

  • mouse and touch event handlers which let the component raise synthetic mousedown events for as long as the user holds down the mouse.
  • repeatDelayDuration state member indicating how long (in milliseconds) after the user presses the mouse down should the mixin wait before firing synthetic mousedown events. The default value is 500 (half a second).
  • repeatIntervalDuration state member indicating how much time should elapse (in milliseconds) between synthetic mousedown events. Default value is 50 (a tenth of a second).

API

Used by classes PlainRepeatButton and RepeatButton.