LavaUI docs

enum ScrollRouter

Swift

enum ScrollRouter

Wheel routing. The node under the pointer receives the wheel, focused or not — that is what every desktop app does, and it means scrolling a panel does not steal focus from a field.

Unlike hover and click, delivery bubbles: the caller supplies the whole ancestor chain under the pointer (LayoutHost.hitTestScrollChain) and the first eligible handler wins. Routing to the single topmost hit instead meant any interactive child — a button, a text field — silently swallowed the wheel for the ScrollView around it.

Sources/LavaUI/Focus.swift:312

Properties

nonisolated(unsafe) static var shiftHeld: Bool { get }

Modifier state carried on the scroll event, so handlers do not have to track key state themselves.

Sources/LavaUI/Focus.swift:323

Methods

@discardableResult static func deliver(to chain: [NodeID], dx: Float, dy: Float, mods: Int32 = 0) -> Bool

Delivers to the innermost node in chain that has a handler willing to take this notch. Returns true if consumed.

Sources/LavaUI/Focus.swift:354

@discardableResult static func deliver(to target: NodeID?, dx: Float, dy: Float, mods: Int32 = 0) -> Bool

Single-node delivery, for callers that resolved one target themselves.

Sources/LavaUI/Focus.swift:371

static func register(_ id: NodeID, canScroll: ((Float, Float) -> Bool)? = nil, handler: @escaping (Float, Float) -> Void)

canScroll is the nested-scroll policy: a container already pinned at its end reports false and the notch continues out to the next eligible ancestor, so an inner list that cannot scroll farther does not deadlock the outer one. Omit it to consume unconditionally.

Sources/LavaUI/Focus.swift:329

static func unregister(_ id: NodeID)

Not documented.

Sources/LavaUI/Focus.swift:337