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

Conditional showing/locking a field #83

Open
wkulczi opened this issue Nov 6, 2020 · 2 comments
Open

Conditional showing/locking a field #83

wkulczi opened this issue Nov 6, 2020 · 2 comments

Comments

@wkulczi
Copy link

wkulczi commented Nov 6, 2020

Hiya!
I'm looking for a way to hide/lock a group of fields based on a value in a checkbox. I've managed to partly resolve my problem using from vue-bootstrap, but unfortunately, using the innerHtml to insert any caption for the checkbox destroys the component (the checkbox disappears!).

I've come across issue #50 that matched my problem
Peek 2020-04-28 01-15

And yet using the sandbox code for that solution in the latest version of the library, the solution refuses to work.

cannot read property 'value' of undefined, says the browser's console.

Sandbox available here.

@jarvelov
Copy link
Owner

jarvelov commented Nov 6, 2020

Hi!

Thank you for reporting this issue. I can confirm that this is a bug. It's a really easy fix though so I will release a patch when I get off work in a few hours. I'll update the sandbox with a working implementation as soon as the new version is up.

@jarvelov
Copy link
Owner

jarvelov commented Nov 6, 2020

Hi again!

I just released v2.9.2 which fixes the cannot read property 'value' of undefined error. Besides that there was another error in the uiSchema. When you apply properties using the dynamicOptions option you must nest them under an options property.

dynamicOptions: {
  schema: { ... },
  options: {
     // fieldOptions must be specified here as a property of the 'options' property
    // they can not be set directly below 'dynamicOptions'
    fieldOptions: { ... }
  }
}

Here's a sandbox with a working example: https://codesandbox.io/s/sad-wood-w52h5

Please let me know if you're facing any more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants