Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefilled, readonly text field for const string types #2600

Open
2 tasks done
mmkal opened this issue Nov 10, 2021 · 3 comments · May be fixed by #3843
Open
2 tasks done

Prefilled, readonly text field for const string types #2600

mmkal opened this issue Nov 10, 2021 · 3 comments · May be fixed by #3843
Labels

Comments

@mmkal
Copy link

mmkal commented Nov 10, 2021

Prerequisites

  • I have read the documentation;
  • [ ] In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
  • I'm providing a shared playground link demonstrating the issue.

Description

[Description of the bug or feature]

Steps to Reproduce

  1. Have a schema using { "type": "string", "const": "something" }

Expected behavior

The input should have the const value already filled in, and have readonly=true

Actual behavior

The input is just a regular textbox, and the user has to type the exact value of const manually (without even a hint of what the value should be)

Version

3.2.0

I'd be happy to open a PR to improve this if someone could point me in roughly the right direction.

@jacqueswho jacqueswho added the bug label Feb 22, 2022
@ranihorev
Copy link
Contributor

Same issue, I wonder if we can create a custom widget for it

@heath-freenome
Copy link
Member

heath-freenome commented Aug 22, 2022

@mmkal Are you still willing to fix this? Some refactoring that was done in version 5 should make fixing this fairly simple. There is a new method in @rjsf/utils called getInputProps() that would be the place to add the fix. The code can be found in the rjsf-v5 branch until it is merged into the master branch when the v5 beta is published

@mmkal
Copy link
Author

mmkal commented Jul 12, 2023

@heath-freenome sorry I missed this message. I'm not using rjsf at the moment any more, so probably won't do this any time soon.

@linpc linpc linked a pull request Aug 26, 2023 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants