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

Add option to keep container scrolling enabled when using Modal #88

Open
jsakas opened this issue Jul 7, 2023 · 2 comments
Open

Add option to keep container scrolling enabled when using Modal #88

jsakas opened this issue Jul 7, 2023 · 2 comments

Comments

@jsakas
Copy link

jsakas commented Jul 7, 2023

Is your feature request related to a problem? Please describe

I am working on a set of components in a library: Dialog, Modal, and Popover. It is feasible that these can be nested in an order. For example, a Modal with a Popover button inside of it.

I want to use the Modal from this library as the base for all three of these, as it allows us to nest these in any order and keeps track of the open order and focus state.

The Modal component can almost be used to create accessible popovers as described, but it needs to allow us to keep container scrolling intact when using stand-alone outside of a modal.

Describe the solution you'd like

A new prop added to Modal, disableContainerScroll, that defaults to true.

@jquense
Copy link
Member

jquense commented Jul 7, 2023

You can control this via the modal manager prop. Check out the constructor options to it to disable the overflow.

@jsakas
Copy link
Author

jsakas commented Jul 17, 2023

Hi @jquense, thanks for the reply and outstanding library.

I see the option you are referring to now; however, in the functionality I've described, the scroll would only be disabled for modals or dialogs but remain enabled for popovers. if I am reading this properly, you would lose the close ordering if you use different modal managers for different component types.

It would be interesting if individual modals override this setting while active, and the modal manager would pull the prop off the modal instance.

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

2 participants