Skip to content

Commit eef1121

Browse files
committed
fix InputNubmer min max problem
1 parent 1aecba6 commit eef1121

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

demo/src/view/main/index/component.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@ export default class Component extends React.Component {
130130
label="Array"
131131
initialValue={[1, 2, 3]}
132132
/>
133-
<InputNumber label="InputNumber" name="input-number" required />
133+
<InputNumber
134+
min={0}
135+
max={5}
136+
label="InputNumber"
137+
name="input-number"
138+
required
139+
/>
134140
<Input label="Email" name="email" required type="email" />
135141
<Input label="Url" name="url" required type="url" />
136142
<Input label="File" name="file" required type="file" />

src/components/form/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,9 +580,11 @@ function getFormItemComponent(that) {
580580
return children[0];
581581
}
582582
deleteUnuseProps(otherItemProps) {
583+
if (otherItemProps.type !== 'input-number') {
584+
delete otherItemProps.min;
585+
delete otherItemProps.max;
586+
}
583587
delete otherItemProps.onlyLetter;
584-
delete otherItemProps.min;
585-
delete otherItemProps.max;
586588
delete otherItemProps.initialValue;
587589
delete otherItemProps.rules;
588590
delete otherItemProps.trigger;

0 commit comments

Comments
 (0)