-
Notifications
You must be signed in to change notification settings - Fork 649
Checkbox in form error #558
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
Comments
@davidlgj can you or someone else take a look at this? I'm having the same issue: Which is definitely from this code. |
+1 |
@JonFir @vinceis1337 @sgarbesi if anyone can put together a gist/plunker/demo that would be a great help? |
@Anthropic I don't remember how exactly I got this problem but I can tell you why it is happening. The issue is that This means that inherently, the checkbox has no reference data from the schema, therefore it logically has no schema property. Therefore, the check I believe the proper fix is to first check whether obj.schema exists as follows:
Please note that this logic occurs in two places: This gist: Demonstrates how the bug halts the creation of the form when reaching this logic. |
@vinceis1337 the dist folder is the built files, so that is fine. What happens if you have a default value on the form definition, is that not enough to avoid the issue? |
@Anthropic I am not sure what you mean. If you mean setting If you mean setting a |
Thanks @vinceis1337 appreciate your help, will need to re-visit this once the new core is split out from this repo to json-schema-form-core. Unless you are in a position to do a PR soon? |
@Anthropic sure, I can make a pull request. I'll need 10 minutes. |
@vinceis1337 that's awesome, the usual response to that question is "maybe next week". Just remember not to commit the dist folder please, and don't be concerned by the tests failing on four items, been meaning to fix them since I updated the CI tool since the repo changed location :) |
@Anthropic Glad to help! Angular Schema Form has been really helpful for me so I don't mind at all :). And I was about to ask if I should gulp before submitting the PR, but that answers the question. :P |
There is a CONTRIBUTING md ;) |
Ooo I see that now. Thanks! #663 created. |
@vinceis1337 if you want to contribute, we are always looking for people to help, the Gitter is a good source for seeing where and when help is needed as we begin the next phase of the project since Textalk gave it up to the internets leading up to v1 :) Closing this now as discussion can move to PR. |
Hello!
I try add checkbox to form
and take error
Error: undefined is not an object (evaluating 'obj.schema['default'])'
I inspect source code, and find this section:
You try determinate
obj.schema['default']
, butobj
not have propertyschema
:My js skill very low) but i try change you code like:
This code work, but i don't know, may be its bad solution.
And i have answer question. Can i add value to checkbox. In default, checkbox can be
true
orfalse
, but i need, add string value, like 'some string', its possible?P.S.: Sorry my low english skill.
Regards.
The text was updated successfully, but these errors were encountered: