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

Đang mở
#616 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@Tatsiana8 đang làm issue này rồi.

Từ ngày 25/6/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
371
Fork
309
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của formio/react

Tất cả issue của formio/react

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.