Guidance on disabling vs hiding form fields
We need some guidance in Pajamas about disabling vs hiding form fields. See this example discussion: https://gitlab.com/gitlab-org/gitlab-ce/issues/60034#note_175801556
The comments in this Stack Exchange raise some great pros and cons of both approaches.
Proposal
- By default, if you're thinking about disabling a form field (see statements below) just hide it instead
- Disable the form field if any of these apply:
- The user will need to fill it, but they must do something before that (fill in another field, press a button, etc.).
- For the user's goal, it's important that they are aware of the field's existence.
- You are not replacing access to one set of controls with access to another set, depending on the user's choices.
For disabled fields they always need a help text below explaining why they are disabled, per Forms, Input fields.