fix(linkageRules): remove throttle to prevent unexpected behavior
This commit is contained in:
parent
136e5405ed
commit
f3c6f066ec
@ -6,7 +6,6 @@ import { reaction } from '@formily/reactive';
|
||||
import { uid } from '@formily/shared';
|
||||
import { getValuesByPath } from '@nocobase/utils/client';
|
||||
import { ConfigProvider, Spin } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import React, { useEffect, useMemo } from 'react';
|
||||
import { useActionContext } from '..';
|
||||
import { useAttach, useComponent } from '../..';
|
||||
@ -234,7 +233,7 @@ function getSubscriber(
|
||||
variables: VariablesContextType,
|
||||
localVariables: VariableOption[],
|
||||
): (value: string, oldValue: string) => void {
|
||||
return _.throttle(() => {
|
||||
return () => {
|
||||
// 当条件改变触发 reaction 时,会同步收集字段状态,并保存到 field.stateOfLinkageRules 中
|
||||
collectFieldStateOfLinkageRules({
|
||||
operator: action.operator,
|
||||
@ -276,7 +275,7 @@ function getSubscriber(
|
||||
// 在这里清空 field.stateOfLinkageRules,就可以保证:当条件再次改变时,如果该字段没有和任何条件匹配,则需要把对应的值恢复到初始值;
|
||||
field.stateOfLinkageRules[fieldName] = null;
|
||||
});
|
||||
}, 500);
|
||||
};
|
||||
}
|
||||
|
||||
function getFieldNameByOperator(operator: ActionType) {
|
||||
|
Loading…
Reference in New Issue
Block a user