Skip to content

Commit

Permalink
fix(FormList): fix multiple FormList stuck (#2788)
Browse files Browse the repository at this point in the history
Co-authored-by: Heising <heising@travelconnect.cn>
  • Loading branch information
HaixingOoO and Heising authored Mar 5, 2024
1 parent 3b9b31d commit 4038b67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/form/FormList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ const FormList: React.FC<TdFormListProps> = (props) => {
Promise.resolve().then(() => {
if (!fieldsTaskQueueRef.current.length) return;

const currentQueue = fieldsTaskQueueRef.current[0];
// fix multiple formlist stuck
const currentQueue = fieldsTaskQueueRef.current.pop();
const { fieldData, callback, originData } = currentQueue;

[...formListMapRef.current.values()].forEach((formItemRef) => {
Expand All @@ -155,7 +156,6 @@ const FormList: React.FC<TdFormListProps> = (props) => {
const data = get(fieldData, itemName);
callback(formItemRef, data);
});
fieldsTaskQueueRef.current.pop();

// formList 嵌套 formList
if (!formMapRef || !formMapRef.current) return;
Expand Down

0 comments on commit 4038b67

Please sign in to comment.