Skip to content

Expose scroll event data #2472

Closed
Closed
@Zagitta

Description

@Zagitta

Feature Request

Currently the onscroll event's ScrollData exposes nothing besides downcasting which leaves downstream users/libraries to deal with platform specifics to obtain scroll position etc.

One example of this is dioxus-lazy where the scroll position is required to calculate which elements to show. What that library does is to keep track of MountedData and on every scroll event downcast that to &web_sys::Element on which scroll_top() is called.
This means that his otherwise great library is limited to only supporting web which is unfortunate.
I attempted to add desktop support but it turns to not even be possible because the equivalent DesktopElement isn't even exposed from the desktop crate.

So instead of requesting that be made public the root issue should be addressed to expose scroll_top() etc in a platform-agnostic way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthtmlRelated to the html crate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions