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

[FEATURE] Ability to close child layers when parent scrolls #64

Open
mtmacdonald opened this issue Mar 9, 2021 · 0 comments
Open

[FEATURE] Ability to close child layers when parent scrolls #64

mtmacdonald opened this issue Mar 9, 2021 · 0 comments

Comments

@mtmacdonald
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When I scroll the parent, react-laag tries to reposition open layers. Mostly this works quite nicely, but sometimes I get very strange positioning (e.g. off the page, so it becomes invisible). An extreme example is when I have nested menus with scrolling parents layers (needed sometimes for long lists). Here is an example (also see screenshots).

Screenshot 2021-03-09 at 14 24 46

Screenshot 2021-03-09 at 14 24 57

Describe the solution you'd like
I would like react-laag to propose a solution to the repositioning problem when a parent layer scrolls. If that's not possible I'd like some advice on what to do in this scenario.

Taking inspiration from native browser elements (e.g. the native select input), they seem to handle it by closing the child layer when the parent scrolls. Is that an approach react-laag can do for me automatically? If not, any implementation tips?

Describe alternatives you've considered

  • I've considering adding an onScroll event listener to the parent layer, and using that to trigger closing of child layers
  • I've considered preventing scroll on the parent when the layer is open (more like a 'modal' approach)

(Optional) Do you want to work on this feature?

Additional context

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