mui / mui/material-ui

[Popover] Positioning overlap with anchorEl when opened near the bottom of the viewport

Open
#32,754 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component: Popover type: enhancement
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Current behavior 😯

The popover overlaps the anchorEl.
MUI Popover - current behavior

Expected behavior 🤔

The popover goes above the anchorEl.
MUI Popover - expected behavior

Steps to reproduce 🕹

This can be reproduced on the Popover anchor playground.

Steps:

  1. Set the anchorOrigin.vertical property to bottom. The popover should now be opening below the anchorEl.
  2. Scroll down so that the anchorEl is at the bottom of the viewport.
    1. Playing around with small scrolling adjustments near the bottom of the viewport yields multiple different popover positioning results, i.e. at the very bottom of the viewport, partially cut off by the bottom of the viewport, and a few pixels above the bottom of the viewport.
  3. Click on the anchorEl to open the popover.
Context 🔦

I am trying to implement a Menu where, when the menu is opened, the menu items are listed below the anchorEl. Additionally, when the user opens the menu near the bottom of the viewport, I would like the menu items to automatically adjust and open above the anchorEl, without overlapping it.

Your environment 🌎

Environment info excluded since this issue is reproducible on the MUI popover anchor playground.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the overlap using the Popover anchor playground with anchorOrigin.vertical set to bottom, then inspect the Popover positioning behavior around viewport boundaries. Confirm the fix by checking that a Popover opened near the bottom moves above the anchorEl without overlapping it and remains stable during small scroll adjustments.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.