mui / mui/material-ui

[TextField] Make fullWidth the default on form element?

Open
#37,310 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion scope: text field waiting for 👍
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
Summary 💡

Coming from https://github.com/marmelab/react-admin/issues/8796, it seems it's common for UI libraries to set fullWidth={true} as the default behavior (see benchmark). Maybe we should do the same for MUI's open-source projects.

Screenshot 2023-05-17 at 18 21 35

https://stackblitz.com/edit/react-ts-fbuqu9?file=App.tsx

An alternative option would be to set a consistent min-width CSS property on all the inputs. However, it would be surprising to override, so unlikely to fly.

Examples 🌈
Motivation 🔦

In most of the time, as a developer, you need to set a width to an input element. Sometimes, it's width: 100%, sometimes, it's not, but it's almost never the default value. So maybe we should make this breaking change.

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 React TypeScript StackBlitz reproduction and the TextField behavior described in the issue. No repository file or test is identified; completion would require an agreed direction for the proposed breaking change and a defined implementation and test scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.