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 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:
@jay-dee Sorry we missed your message here! In cause it’s still an issue, this should fix it:
The total is initialized correctly, but the slot is set not to render, and most step instances inherit default text that tries to read the page’s state from inside the reusable component. Making the slot visible and supplying the bound text from each page instance should fix it.
Separately, the step-number state exposed by the component is available only after that component mounts. Using that state to decide whether it mounts prevents initialization. Keep the visibility condition based on the page’s current step number, as in your `formStep === 1` example.