Form text field initial value not updating in preview or publish mode

What are you trying to do? (please be as specific as possible and include relevant screenshots, code snippets)
I am trying to update the initial value of the form text input through state. It gets updated in interactive mode but doesn’t work in preview or publish mode. Moreover, the value gets updated for a simple text input as well

I have created a test example to show it

https://studio.plasmic.app/projects/u5enwxsNkAs5cmvjfcmPq4/-/test?arena_type=component&arena=sqkl9Io3VYDw
In this example, on the click of the button I am trying to show that the value changes from test to testpass. It happens for both form text input as well as text input in interactive mode but happens only for the text input in preview and publish mode.

Same is my project.
What are the reproduction steps?

Relevant links:

1 Like

@fmota

Hi, this seems like a bug, if you bind in the Form element instead of the Form Field it should work.

Thanks for the update. Unfortunately I will not be able to use the form element to set initial values. Could you please get this fixed if it’s a bug.

Thanks

@fmota Please could you check this. It has not been fixed

2 Likes

@fmota

Hello!

I am not sure this is the exact same issue, but it seems related.

Building a multistep form, I am trying to get the value of two state variables of my page in a component, one in a text element ( $state.totalSteps ), and the other in a visibility condition ($state.formStepComponent1.formPropStepNumber).
I have set an inital value for both.
The value seems to be correctly set as I can display them in a text element on the page both in edit, preview or publish mode.
However, in preview and publish mode, it does not display in a text element inserted in a component’s slot, and it does not work in the visibility condition of the component using:

$state.formStep === $state.formStepComponent1.fromPropStepNumber

But it does work in edit mode.

There you can see the totalSteps value “26” displayed in the page and in the component’s slot in edit mode, and the component displayed.

In preview mode the formStepComponent1.formPropStepNumber value is undefined and therefore my component (step 1 of my form) is hidden.

When I “force” the visibility of my component by changing the condition to

$state.formStep === 1

it is visible but the totalSteps text which is inserted in the component is empty (page 1 / nothing) whereas it was displayed in edit mode.

My project