Skip to content

Commit ae7c9f0

Browse files
Chore document antd BaseInputTemplate as to why step='1' is used (#4880)
1 parent 957b867 commit ae7c9f0

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ should change the heading of the (upcoming) version to include a major version b
2020
## @rjsf/antd
2121

2222
- Updated `SelectWidget` to add a static `getPopupContainerCallback` to the `SelectWidget` component, partially fixing [#3609](https://github.com/rjsf-team/react-jsonschema-form/issues/3609)
23+
- Also, added the explicit `open` state to the `Select` in conjunction with providing the `setOpen` as the `onOpenChange` prop
2324

2425
## @rjsf/mantine
2526

packages/antd/src/templates/BaseInputTemplate/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export default function BaseInputTemplate<
4343
type,
4444
} = props;
4545
const { formContext } = registry;
46+
// InputNumber doesn't use a native <input type="number"> directly - it wraps it and controls the stepping behavior
47+
// through its own props. The step prop in Ant Design expects a number, not the string "any"
4648
const inputProps = getInputProps<T, S, F>(schema, type, options, false);
4749
const { readonlyAsDisabled = true } = formContext as GenericObjectType;
4850

packages/antd/src/widgets/SelectWidget/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ export default function SelectWidget<
107107
value={selectedIndexes}
108108
{...extraProps}
109109
// When the open change is called, set the open state, needed so that the select opens properly in the playground
110-
onOpenChange={(open) => {
111-
setOpen(open);
112-
}}
110+
onOpenChange={setOpen}
113111
filterOption={filterOption}
114112
aria-describedby={ariaDescribedByIds(id)}
115113
options={selectOptions}

0 commit comments

Comments
 (0)