material-components / material-components/material-web
md-menu/md-select overlay positions itself too far to the left side of the anchor element
Nobody has claimed this yet.
- Dominant language
- SCSS
- Stars
- 11.3k
- Forks
- 1.1k
- Avg merge
- 20h 28m
- Merged PRs (30d)
- 13
Description
### What is affected?
Component
### Description
When using **md-menu** with _positioning_ `popover` or `document` the overlay goes 10ish? pixels too far to the left side of the anchor.
The expected behavior would be for the overlay to be left? aligned with the anchor button.
This is also a problem in **md-select**, which is where I initially noticed the problem.

### Reproduction
The problems are visible on the material-web.dev website already
https://material-web.dev/components/menu/#popover-positioned-menus

https://material-web.dev/components/menu/#document-positioned-menus

And the select:
https://material-web.dev/components/select/#usage

### Workaround
I have not found a workaround.
### Is this a regression?
No or unsure. This never worked, or I haven't tried before.
### Affected versions
1.3.0
### Browser/OS/Node environment
Browser: Version 122.0.6261.112 (Official Build) (64-bit)
OS: Windows 11 Pro, version 23H2, build 22631.3155
Node version: v20.11.0
npm version: 9.6.7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the offset in the linked md-menu popover-positioned and document-positioned demos, then compare the md-select usage demo. Trace the positioning entry points for the popover and document modes; done means both overlays are left-aligned with their anchor elements without breaking either component.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scss
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100