Skip to content

Commit

Permalink
💥 feat(table): onReset support search. transform
Browse files Browse the repository at this point in the history
  • Loading branch information
DerrickTel committed Dec 2, 2020
1 parent 93a43f1 commit f242d03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/table/src/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,13 @@ const FormSearch = <T, U = any>({
}
}}
onReset={() => {
if (onReset) {
if (onReset && valueTypeRef.current) {
const value = formInstanceRef.current?.getFieldsValue() as T;
onReset(value);
const finalValue = transformKeySubmitValue(
conversionSubmitValue(value, dateFormatter, valueTypeRef.current) as T,
transformKeyRef.current,
);
onReset(finalValue);
}
}}
onFinish={() => {
Expand Down

0 comments on commit f242d03

Please sign in to comment.