Changing the display from form to wizard to form and then removing the panel breaks the builder

Ouverte
#616 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

@Tatsiana8 y travaille déjà.

Depuis le 25/6/2025.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

Describe the bug
When you render the FormBuilder, if you change the display type from form to wizard and then back to form, the builder is still on wizard mode after adding a new component and the component you just tried to add disappear until you click on the +page button

To Reproduce
Steps to reproduce the behavior:

  1. Render the builder using the <FormBuilder /> component
  2. keep a reference to the builder using the onBuilderReady prop
  3. change the display type to wizard (using the builder reference)
  4. change the display type back to form (using the builder reference)
  5. remove the remaining panel
  6. add a new textfield

Expected behavior
The builder should be in form mode and behave normally

Screenshots
Gif demonstrating the issue

Image

Sandbox Example
builder-display-bug.zip

the zip file contain a simple vite app unzip it, run npm i and npm run dev to test the issue, here is the actual code used to recreate the bug:

import { FormBuilder } from "@formio/react";
import { useCallback, useRef } from "react";

function App() {
	const ref = useRef(null);
	const onBuilderReady = useCallback((builder) => {
		ref.current = builder;
	}, []);

    return (
        <>
			<select onChange={(e) => {
				ref.current.setDisplay(e.target.value);
			}}>
				<option value="form">form</option>
				<option value="wizard">wizard</option>
			</select>
			<FormBuilder onBuilderReady={onBuilderReady}/>
        </>
    );
}

export default App;

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version Version 137.0.7151.104 (Official Build) (64-bit)

Smartphone (please complete the following information):

Not tested

Langage dominant
TypeScript
Étoiles
371
Forks
309
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de formio/react

Toutes les issues de formio/react

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.