Skip to content

Commit

Permalink
fix(form): fix DigitRange un support theme error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jun 24, 2023
1 parent c86532f commit 70ad3bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/field/src/components/DigitRange/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useIntl } from '@ant-design/pro-provider';
import { proTheme, useIntl } from '@ant-design/pro-provider';
import { Input, InputNumber } from 'antd';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import React from 'react';
Expand Down Expand Up @@ -40,6 +40,7 @@ const FieldDigitRange: ProFieldFC<FieldDigitRangeProps> = (
const { value, defaultValue, onChange, id } = fieldProps;
const intl = useIntl();

const { token } = proTheme.useToken();
const [valuePair, setValuePair] = useMergedState(() => defaultValue, {
value: value,
onChange: onChange,
Expand Down Expand Up @@ -117,7 +118,7 @@ const FieldDigitRange: ProFieldFC<FieldDigitRangeProps> = (
borderInlineStart: 0,
borderInlineEnd: 0,
pointerEvents: 'none',
backgroundColor: '#FFF',
backgroundColor: token?.colorBgContainer,
}}
placeholder={separator}
disabled
Expand Down
3 changes: 2 additions & 1 deletion packages/table/src/components/Form/FormRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ const FormRender = <T, U = any>({
formRef={formRef}
action={action}
dateFormatter={dateFormatter}
onInit={(values: T) => {
onInit={(values: T, form) => {
formRef.current = form;
// 触发一个 submit,之所以这里触发是为了保证 value 都被 format了
if (type !== 'form') {
// 修改 pageSize,变成从 url 中获取的
Expand Down

0 comments on commit 70ad3bc

Please sign in to comment.