Skip to content

Add option to NOT nest the element #3

@desto-git

Description

@desto-git

Finally with scrollbar-width there's also a way to hide the scrollbar in Firefox without breaking it's scrolling functionality.

Now all major browsers support a way of hiding the native scrollbar. As such, it's legitimate to offer an option to not wrap the element into an overflow: hidden; container.

Benefits:

  • it does not mess with the elements
    • no care needs to be taken when working with the target element in JS
    • referencing elements inside it before using scrollbarjs.add() no longer breaks the reference
    • adding scrollbars to be body has no side effects (especially autohiding url bar on mobile)
  • styling
    • scrollbars can overflow the content, thus can be placed outside the viewport
    • no need to handle direction: rtl;
    • no ::after workaround to add padding to the bottom needed

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