メインコンテンツまでスキップ

pointer/wheel

Interfaces

WheelInstance

Defined in: dom/src/pointer/wheel.ts:18

Properties

destroy
destroy: () => void;

Defined in: dom/src/pointer/wheel.ts:21

Returns

void

update
update: (options) => void;

Defined in: dom/src/pointer/wheel.ts:20

Replace the given options, keeping the listener in place.

Parameters
ParameterType
optionsWheelOptions
Returns

void


WheelOptions

Defined in: dom/src/pointer/wheel.ts:1

Properties

requireFocus?
optional requireFocus?: boolean;

Defined in: dom/src/pointer/wheel.ts:15

Only report events while the focus is inside the element.

A control that reacts to the wheel on hover alone takes the scroll away from the page, so passing over one in a long form silently changes its value. Requiring focus makes that an explicit act.

The check is contains, not an identity test: the element that actually takes focus is usually a descendant, such as a thumb or an <input>, and a caller may have replaced it with markup of their own.

Default
false

Functions

createWheel()

function createWheel(
element,
onWheel,
options?
): WheelInstance;

Defined in: dom/src/pointer/wheel.ts:30

Listen to wheel events on an element.

The listener is registered with passive: false so that the handler can call preventDefault() to stop the page from scrolling.

Parameters

ParameterType
elementElement
onWheel(event) => void
optionsWheelOptions

Returns

WheelInstance