formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

[BUG] formio.setSubmission({...}) does not set custom components submission data.

Open CatBakun opened this issue 4 years ago • 7 comments

Environment

Please provide as many details as you can:

  • Hosting type
    • [x] Form.io
    • [ ] Local deployment
      • Version:
  • Formio.js version: latest (4.13.11)
  • Frontend framework: Default/VanillaJS
  • Browser: Any
  • Browser version: Any

Steps to Reproduce

  1. Create a form with a custom component along with Formio default components.
  2. Set the form submission with submission data for all components (custom and defaults)

Expected behavior

The custom component can render the whole submission data values set in step 2.

Observed behavior

The custom component key/value pair in the submission data gets lost somewhere.

Example

http://jsfiddle.net/07cn3fer/

CatBakun avatar Dec 27 '21 17:12 CatBakun

@CatBakun Did you ever find a fix for this? Experiencing the same thing

Alexa-Green avatar Aug 03 '22 22:08 Alexa-Green

@Alexa-Green, @CatBakun. I'm with the same issue. Any solutions?

henriquesoareslima avatar Aug 21 '23 16:08 henriquesoareslima

@henriquesoareslima Implemented a local saving of the custom component details in state if I remember correctly, then re-injected that for handling the final submission. Not ideal or that dynamic, but it is a workaround.

Alexa-Green avatar Aug 23 '23 18:08 Alexa-Green

Thanks @Alexa-Green. It's cool. I implemented different. I set the component value in the dataset tag and put that in the application. This is also not ideal.

henriquesoareslima avatar Aug 23 '23 18:08 henriquesoareslima