-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
use select widget to render oneOf / anyOf control #1220
Conversation
I have 3 tests failing locally on master, as well as this branch. Also, I am curious if any other props need to be plumbed through to the select widget. It feels a little weird to provide a stubbed schema, but that may be ok for this use case. Just let me know if I can update anything. |
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.
A stubbed schema seems fine, thanks!
You should probably pass in the props listed here, as well.
In addition to the autofocus and placeholder attributes (see #1223 -- maybe we can get these attributes from the uiSchema entry of the oneOf once #1141 is resolved). For now, just add which attributes you are able to without needing the uiSchema. |
* change schema type to number * get uiOptions to pass to widget
@epicfaace Let me know if we shouldn't just get the uiOptions now without #1141. It didn't appear to make a difference since the defaults are falsey. |
@epicfaace are you still waiting for changes? |
@a-b-r-o-w-n sorry for the delay. Can you also add tests for oneOf & anyOf in which you actually define a |
🤦♂️ I thought I already had. I'll update the specs |
Thanks! |
Can anyone add an example on the play ground for this? It would be really helpful. |
@mravenash I don't think the playground supports custom widgets since it is just json. Here is a codesandbox link that has an example though: https://codesandbox.io/embed/6wxv10mz2k |
It works, the fix was in 1.5, was using 1.4. Thanks Andy for quickly giving the sandbox example.!! |
Is there any way to remove the border that encapsulates the custom widgets? I see this css classname fieldset and its border-width is set to 2px. Is there any way to override it? Any inputs will be appreciated. |
What I have done is to either provide a custom field template or just use css to modify the border: .MyForm {
fieldset {
border: none;
}
} |
Reasons for making this change
Fixes #1219. oneOf / anyOf will now use the
SelectWidget
to render the top control. This can be customized by the user.Checklist
npm run cs-format
on my branch to conform my code to prettier coding style