I want to request a readonly option field in the string widget
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
**Is your feature request related to a problem? Please describe.**
Currently, the string widget only supports the `default` and `hidden` options. However, I have a scenario where I need to display certain fields like “Author” to the user, populated via cookie information, but I do not want the user to be able to edit this field. Since there’s no built-in `readonly` option, I’m forced to either disable the field (which prevents selecting/copying) or create a custom widget (which increases complexity).
**Describe the solution you'd like**
I’d like to see a `readonly` option added to the string widget. When `readonly` is set to `true`, the widget should render the field as a read-only input:
- The value remains visible to the user
- The field cannot be edited
- The text can still be selected and copied by the user
This aligns with common UX patterns (like HTML’s ``).
**Describe alternatives you've considered**
- **Custom widgets**: More effort to maintain and ensure consistency with the rest of the application.
- **Hidden fields**: Not helpful here because I do want the user to see the field’s value.
**Additional context**
This feature would simplify the handling of metadata fields (like Author or Timestamps) that should be visible but not editable by the user. It would reduce the need for workaround solutions and improve the overall user experience.
Contributor guide
Assessment
This issue has not been assessed yet.