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

Enable checkbox widget for string field with const #3882

Open
1 task done
AdrienRosi opened this issue Sep 27, 2023 · 2 comments
Open
1 task done

Enable checkbox widget for string field with const #3882

AdrienRosi opened this issue Sep 27, 2023 · 2 comments
Labels
core feature Is a feature request help wanted

Comments

@AdrienRosi
Copy link

Prerequisites

What theme are you using?

core

Is your feature request related to a problem? Please describe.

Consider the schema bellow :

{ "title": "Confirmation", "description": "Please to confirm this value is foo", "type": "string", "const": "foo" }

My expectation is to render this schema as a checkbox (two states : value is "foo" = checked or value is empty = not checked), but that behavior is not allowed in UI schema in accordance with the doc.

Describe the solution you'd like

String field with const constraint should be able to be render as checkbox :

  • Value attribute should be set as const constraint
  • If checked, model should be updated based on value attribute
  • If not, property is removed from the model

Describe alternatives you've considered

No response

@AdrienRosi AdrienRosi added feature Is a feature request needs triage Initial label given, to be assigned correct labels and assigned labels Sep 27, 2023
@heath-freenome
Copy link
Member

@AdrienRosi This sounds like a nice feature add. Are you willing to do the implementation?

@heath-freenome heath-freenome added core help wanted and removed needs triage Initial label given, to be assigned correct labels and assigned labels Oct 6, 2023
@AdrienRosi
Copy link
Author

I work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature Is a feature request help wanted
Projects
None yet
Development

No branches or pull requests

2 participants