Skip to content

Position of select menu not based on scrollable parent #3822

@prateekgarcha

Description

@prateekgarcha

As mentioned in PR 3531,

It does not solve all use cases, as there is still code that checks for available view height on window (viewSpaceBelow >= menuHeight), and not inside the container.

I'm facing the similar issue when the menu is present near the bottom of the view area inside a scrollable div, in my case a slide panel, the menu's positioning is being based on the window height and not the scrollable parent.
The following are the issues that I'm facing:-

  1. The menu is being truncated if there is some other container at the bottom of the page but the menu can fit inside the window and is being placed at the bottom.
  2. The scrollable div is not being scrolled to bring the menu into the view.
  3. If I use menuPosition = "fixed", I'm able to remove the truncation problem, but that brings another issue as the position of menu is not being changed if the parent div is scrolled up or down.

I'm working on a fix for the getMenuPlacement function inside Menu.js, and trying to change the calculations based on the scrollable parent instead of using the window every time. If there is no scrollable parent, then the default thing will be working as is.
If anyone else is working on this issue, do let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yetissue/has-prIssue has a PR attached to it that may solve the issueissue/reviewedIssue has recently been reviewed (mid-2020)menu-bugAddresses menu positioning, scrolling, or general interactions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions