Field editor rendered twice when moving back n forth in wizard

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
  • (Edited)
Hi,

I have a field editor for capturing payment info from customer on step-3 of a wizard.
If user goes back to previous steps and come back to this 3rd step.

this editor is doubled and layout shows twice.

Any ideas what is causing this ?

Note: I am not having any render conditions on this Editor but on the fields in this editor.

Below is the snapshot of that specific model data printed on console:


Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Skuid will show one field editor for each row in the model.

It looks like one of the steps in your wizard is creating a new row, so each time the user clicks one of your 'next' buttons a row is created. You'll see one field editor for each time you've clicked the button that creates a row.

Couple ways to handle this: 
(1) make the button remove all rows before creating a row.
(2) make two 'next' buttons, one that creates a row and moves on, and one that just moves on. Then, conditionally render them based on whether the model has rows.