mui / mui/material-ui

[Stepper] `alternativeLabel` makes text not reach the edges of the container

Open
#24,536 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design has workaround scope: stepper
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

When 'alternativeLabel' is applied to a stepper the connector is made a child of the the step succeeding it and is absolutely positioned. By each step evenly spacing in the bounds and being centered it no longer takes up the whole space it is given (or at least from a viewing perspective).

What it looks like now:

Screen Shot 2021-01-21 at 10 37 52 AM

What it should look like:
Screen Shot 2021-01-21 at 10 46 59 AM

I was able to accomplish this by not making the connector a child of the succeeding step (using the same layout as the non-alternativeLabel variant, removing flex: 1 on each step, removing all the alternativeLabel styles on the connector, and adding margin-top: theme.spacing(1.25) to the connector.

I could potentially pick this issue up, but I'm sure there was reasons for the absolute positioning method so wanted to open a discussion on it first to see what else may need to be considered.

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 Stepper alternativeLabel layout and connector positioning described in the issue. Compare the current and expected layouts, then verify that the connector reaches the container edges without regressing the standard Stepper variant.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.