Skip to content

useLockBodyScroll: add padding to the body as well with overflow hidden #324

Open
@ike-gg

Description

@ike-gg

currently, when using the useLockBodyScroll hook, you may experience layout shifting when switching the value of the overflow property

to avoid this, you should also add padding-right to the body element to prevent shifting- 15px should be fine in most cases

perhaps consider adding this as an optional feature (as well with the value of the padding) as a prop to the hook?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions