Skip to content

scrollIntoView missing newer options #414

Open
@nafg

Description

@nafg

def scrollIntoView(top: Boolean = js.native): Unit = js.native

From lib.dom.d.ts:

scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
interface ScrollIntoViewOptions extends ScrollOptions {
    block?: ScrollLogicalPosition;
    inline?: ScrollLogicalPosition;
}
interface ScrollOptions {
    behavior?: ScrollBehavior;
}
type ScrollBehavior = "auto" | "smooth";
type ScrollLogicalPosition = "center" | "end" | "nearest" | "start";

In particular, it would be great not to have to write

div.asInstanceOf[js.Dynamic].scrollIntoView(js.Dynamic.literal(block = "nearest")).asInstanceOf[Unit]

More broadly how is this repo kept in sync with browser APIs? Can ScalablyTyped help somehow?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions