removeFieldValue keeps data from subfields when used with form.AppField - unable to delete last row in AgGrid

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

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với bản reproduction StackBlitz được liên kết và truy vết removeFieldValue khi được sử dụng với form.AppField, tập trung vào mục fieldMeta vẫn còn lại cho age sau khi xóa. Xác nhận hành vi bằng cách xóa hàng cuối cùng và gửi biểu mẫu; hoàn tất khi phần tử cha và các trường con của nó được xóa, đồng thời biểu mẫu có thể được gửi mà không có lỗi xác thực cũ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

v1 v2: needs investigation
Describe the bug

I am using Tanstack Form with AgGrid. When calling removeFieldValue, some subfields persist even after the parent field is removed. I suspect it has something to do with form.AppField. I noticed this problem when trying to delete the last row in AgGrid. When attempting to save the form after deleting the last row, the form is invalid and cannot be submitted.

Similar to this problem here: https://github.com/TanStack/form/issues/1178

Your minimal, reproducible example

https://stackblitz.com/edit/bolt-vite-react-xodftmth?file=src%2FApp.tsx

Steps to reproduce
  1. Enter stackblitz
  2. Click Delete
  3. Click Submit
  4. Error is displayed because form is invalid
  5. Checking dev tools console logs, you can see that after the delete, the age field is left in fieldMeta
Expected behavior

I expect subfields to also be removed when removing the parent field.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Windows 10
Chrome 141.0.7390.78

TanStack Form adapter

None

TanStack Form version

v1.23.7

TypeScript version

v5.9.2

Additional context

No response

Ngôn ngữ chính
TypeScript
Star
6.8k
Fork
705
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
13

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 TanStack/form

Tất cả issue của TanStack/form

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.