material-components / material-components/material-web

Buttons are not robust to position:static.

Open
#5,339 1 comment 0 reactions 0 assignees View on GitHub

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

Setting `position: static` to button breaks them.

### Without static:
![Selection_428](https://github.com/material-components/material-web/assets/1168053/3a312658-53be-4861-a054-4229cc29c46b)

### applying style position:static:
![Selection_427](https://github.com/material-components/material-web/assets/1168053/4f3f40f0-32c3-4dd9-8442-413e75080403)

There is a kind of related discussion in #5309 - but I think the situation is different here.

### Reproduction

https://lit.dev/playground/#gist=6cd3dda1b04aa08deb3350ae72b166bc

### Workaround

Wrapping buttons around a `div` with position=static, I guess.

### Is this a regression?

Yes. This used to work, but now it doesn't.

### Affected versions

Failing 1.1.0, working 1.0 I thing

### Browser/OS/Node environment

Linux chrome 120.

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

Start with the linked Lit Playground reproduction and compare the button behavior between the working 1.0 version and failing 1.1.0 behavior when position: static is applied. Trace the affected button component styles and verify that buttons remain intact under position: static, with a regression check for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
scss
Domain
frontend, web-dev
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.