mui / mui/material-ui

[docs][joy-ui][input] Inputs as decorators for other inputs in forms

Open
#39,687 1 comment 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Oct 31, 2023.

design: joy docs on hold scope: text field support: docs-feedback
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
Related page

https://mui.com/joy-ui/react-input/#decorators

Kind of issue

Other

Issue description

The decorator documentation of Input kicks off with an Input that has another Input as its endDecorator. But as soon as you'd want to use that in an actual form with a FormLabel and FormHelperText component wrapped in a FormControl, Joy UI will start throwing errors at you that you aren't allowed to do this.

A FormControl can contain only one control component (Autocomplete | Input | Textarea | Select | RadioGroup)
You should not mix those components inside a single FormControl instance
Context 🔦

I feel like this demo should be something that can actually be used in a context that goes beyond "I just want 2 inputs" and works with Joy UI's other components. This demo specifically could be fixed by replacing the Select with a Dropdown to achieve roughly the same result.

Then again... mayhaps changes should be made to FormControl to allow 2 or more inputs. Examples like the demo feel like a common usecase (e.g.: a search box with a control to specify where you want to look).

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.