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

Field options not working as expected (values must equal labels) #549

Closed
delyanr opened this issue Jul 8, 2019 · 2 comments
Closed

Field options not working as expected (values must equal labels) #549

delyanr opened this issue Jul 8, 2019 · 2 comments
Assignees
Labels
Type: Bug Bug reports and their fixes

Comments

@delyanr
Copy link

delyanr commented Jul 8, 2019

Hello!

Related: #517

Context: Uniforms v2.1.0; JSON Schema; Ant Design

I'm trying to use options to define field names to use with checkboxes enabled; however, there is some weird issue where if the label is different from the value, then the particular checkbox loses the ability to check and un-check.

You can test it with the following schema:

{
    "type": "object",
    "properties": {
        "impact": {
            "type": "array",
            "title": "Select impacts:",
            "items": {
                "type": "string"
            },
            "options": [
                {
                    "label": "Impact One",
                    "value": "Impact One"
                },
                {
                    "label": "Impact Two",
                    "value": "Impact Two"
                },
                {
                    "label": "Impact Three",
                    "value": "Impact Three"
                },
            ],
            "uniforms": {
                "checkboxes": true
            }
        }
    }
 }

Changing the label or value anywhere bugs out.

Please have a look.

Thanks!

@radekmie radekmie added the Type: Bug Bug reports and their fixes label Jul 9, 2019
@radekmie radekmie self-assigned this Jul 9, 2019
@radekmie
Copy link
Contributor

radekmie commented Jul 9, 2019

Great bug report @delyanr! I'll look into that soon.

@delyanr
Copy link
Author

delyanr commented Jul 13, 2019

@radekmie Thanks for the quick fix - working like a charm now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug reports and their fixes
Projects
Archived in project
Development

No branches or pull requests

2 participants