scrollIntoViewIfNeeded

suspend fun scrollIntoViewIfNeeded(args: DOM.ScrollIntoViewIfNeededParameter, mode: CommandMode = CommandMode.DEFAULT)

Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.


suspend fun scrollIntoViewIfNeeded(nodeId: Int? = null, backendNodeId: Int? = null, objectId: String? = null, rect: DOM.Rect? = null)

Scrolls the specified rect of the given node into view if not already visible. Note: exactly one between nodeId, backendNodeId and objectId should be passed to identify the node.

Parameters

nodeId

Identifier of the node.

backendNodeId

Identifier of the backend node.

objectId

JavaScript object id of the node wrapper.

rect

The rect to be scrolled into view, relative to the node's border box, in CSS pixels. When omitted, center of the node will be used, similar to Element.scrollIntoView.