mui / mui/material-ui

[material-ui][Select] Documentation improvement opportunities

Open
#40,364 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs scope: select
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
  • There are lots of duplicates ... which is the entire point of this ticket.
Latest version
  • I have tested the latest version
Summary 💡

MUI is a fantastic library, and it's largely a drop-in replacement for existing UI paradigms. Have an <input>? Replace it with a MUI <Textbox> for a better look and more features. You might need to spend 2 seconds reading the docs, but then you can easily implement it ... and that's true for almost everything in MUI ... except Select.

If you google you can find hundreds of problems people have run into with doing even the most basic things using the MUI Select (eg. control its width or provide a placeholder value). Many of those issues/Stack Overflow posts/etc. have no resolution, but among those that do, the solution in the majority of the cases is .... to use a Textbox (with the select option).

Fundamentally, when everyone has to use MUI's equivalent of an <input> to accomplish the equivalent of a <select>, something isn't right. The MUI Select component should solve the vast majority of people's dropdown needs, and the Textbox with a select prop should be a rarely used option for special cases. The fact that it's the exact opposite is clearly a pain point for users (as evidenced by all the internet questions).

And look, if you really want people using select textboxes, that's perfectly fine ... but then say so! Deprecate the Select and tell people to use the Textbox instead :). Or at least put a big banner at the top of the Select page saying you should seriously consider it.

Right now you have a component that is doing a poor job of serving its function (so poor everyone has to use another component in its place). Please, either make it do its job, or don't make everyone go searching through the interwebs ... just tell us the right component to use.

Examples 🌈

This is like 20 seconds of Googling; there are many more out there:

https://stackoverflow.com/questions/73386626/how-can-i-prevent-mui-select-component-width-from-getting-expanded-as-i-select-m
https://stackoverflow.com/questions/51408492/set-the-width-of-material-ui-select-based-on-label-size
https://stackoverflow.com/questions/56120213/set-material-ui-select-width
https://stackoverflow.com/questions/59260429/how-to-increase-the-width-of-material-ui-dropdown
https://stackoverflow.com/questions/64644708/material-ui-set-select-to-be-as-wide-as-widest-menuitem
https://stackoverflow.com/questions/76983668/adding-max-width-to-a-materialui-select-element
https://stackoverflow.com/questions/73807962/having-trouble-implementing-placeholder-in-textfield-that-has-select-prop-mui
https://stackoverflow.com/questions/58645424/select-placeholder-styling
https://stackoverflow.com/questions/54289877/change-text-colour-of-placeholder-in-select-drop-down-material-ui
https://github.com/mui/material-ui/issues/8778
https://github.com/mui/material-ui/issues/20689
https://github.com/mui/material-ui/issues/3923
https://github.com/mui/material-ui/issues/10917
https://github.com/mui/material-ui/issues/33559
https://github.com/mui/material-ui/issues/18797
https://github.com/mui/material-ui/issues/11069

Motivation 🔦

I just want to be able to

  1. Go to MUI's website
  2. Find out the proper way to do basic things (render a drop-down menu, and not have it or its options be super-small)
  3. Be able to easily implement that way from the documentation.

That's all I'm asking for ... but fundamentally the above isn't possible with the current Select component and its documentation.

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 MUI Select documentation and review the linked Stack Overflow questions and related GitHub issues to identify recurring problems. Define whether the outcome is clearer guidance, a recommendation to use TextField with select, or Select changes; done means users can find documented solutions for basic dropdown sizing and placeholder needs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation, frontend
Issue type
Documentation
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.