Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a custom base element (not body) #260

Closed
kalnode opened this issue Oct 16, 2022 · 1 comment
Closed

Define a custom base element (not body) #260

kalnode opened this issue Oct 16, 2022 · 1 comment

Comments

@kalnode
Copy link

kalnode commented Oct 16, 2022

Hello!

Is it possible to define a top-level locking target other than body ?

Context: I use a popular web app framework (for various reasons) which abstracts many things. The end result is the app is completely contained in a child of body, therefore any changes this plugin makes to body have no effect. Body is literally 100% screen width and height. The actual page content that should scroll (and be locked/unlocked), is yet in a deeper child.

To confirm the situation in my app, using a browser inspector, I manually toggled overflow auto/hidden on body and it had no effect on the app content. Meanwhile if I do the same on the child element that contains the app, then it works as expected. I just need this plugin to integrate with a base element different than body.

@kalnode kalnode changed the title Lock a custom element (not body) Define a custom base element (not body) Oct 16, 2022
@kalnode
Copy link
Author

kalnode commented Oct 17, 2022

In hindsight I realize this isn't actually a problem.

This plugin operating on body is fine and desired (to counteract spring effects on mobile devices, for instance). When it comes to other UI layers in the app, then I simply need to manually toggle overflow for those areas in addition to using this plugin. All of that logic should be contained in some custom "lockScrolling" component.

@kalnode kalnode closed this as completed Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant