Skip to content

Global OverlayScrollbars #485

@ferferga

Description

@ferferga

Is your feature request related to a problem? Please describe.
I want to have the same overlay scrollbars, with the same settings across my app, without having to take care of instantiating it manually.

Describe the solution you'd like
A deep key (with a boolean value) for the OverlayScrollbar instance options that chooses between adding the data-overlayscrollbars-initialize attribute and the overlayed scrollbars to every child (recursively) of the target element during the instantiation of the instance.

Describe alternatives you've considered
Creating my own Mutation Observer and doing all this process manually.

Additional context

  • An additional attribute data-overlayscrollbars-deep-ignore can be added so that element and its descendents are ignored, in case the user wants to instantiate a different OverlayScrollbars instance with a different set of options from the global one.

  • For frameworks like Vue, a directive could be used instead.

  • An additional option replaceGlobalAPIs to use in conjuction with deep that replace global APIs like window.scrollTo with functions that keep the same APIs intact, but call the scrolling to the global OverlayScrollbars instance would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions