koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
539 stars 154 forks source link

Error in next tick when using switch in sub schemas #214

Open shirulaf opened 3 years ago

shirulaf commented 3 years ago

Hi,

There is an issue with the DOM changing while editing a sub schema, wrapped in OneOF, with a switch.

How to reproduce: https://codepen.io/shirulaf/pen/GRNPMPM?editors=1010

  1. Select the presented item to edit
  2. Change the switch mode

See that:

  1. In the view - the presented item data is not updated
  2. The data in the model is updated
  3. The next error is thrown:

`[Vue warn]: Error in nextTick: "TypeError: s.$refs[("item-" + i)] is undefined" found in ---> ... (1 recursive calls)

vue.js:634:17` Also, when not wrapping in oneOf, we see that the view is being updated, although the error is still being thrown.
albanm commented 3 years ago

The editable array example from the doc was also broken with the same error message. I fixed it and released a patch version, can you check if your use-case is also fixed ?

lirantiebloom commented 3 years ago

Hi,

By using version 1.23.0, it seems the view is updated, however the const from the drop down appears as [object object] When using latest / 1.23.9 the problem still persists, the view does not update, the data and the model is updated. So unfortunately, this doesn't seems to resolve the issue.

albanm commented 3 years ago

I think this is solved in latest release.

lirantiebloom commented 3 years ago

Thanks, by explicitly using 1.24.1 and not latest, the issue does resolve :)