-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix id of anyof select #1212
Fix id of anyof select #1212
Conversation
@LucianBuzzo could you please review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test to make sure this does not regress ?
@edi9999 I just changed the id, so I'm not sure how a test could meaningfully cover this change; what kind of test do you have in mind? |
I mean a test like here : https://github.com/mozilla-services/react-jsonschema-form/blob/master/test/BooleanField_test.js#L40 Where you render that component and verify that the id is the expected one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, can you please add a test that checks that the ID is correct?
I've added tests -- but I realized that both the oneof and anyof widgets have the same id (i.e., "__anyof_select" instead of "__oneof_select" and "__anyof_select"). Was this intentional or do you think we should fix this as well? |
Good catch, I think it is not intentional and we should fix it. |
This is technically a backwards incompatible change anyway, so let's just add this in v2. |
@LucianBuzzo / @edi9999 could you review? |
This fixes a change that was done in #1118. It seems like the id should be suffixed with a double underscore, not a single underscore.
For example, see examples here (https://github.com/mozilla-services/react-jsonschema-form/blob/master/src/components/fields/ArrayField.js#L27)