Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
should change the heading of the (upcoming) version to include a major version bump.

-->
# 6.1.2

## @rjsf/mantine

Align Mantine’s behavior with other themes when clearing string fields: clearing an input now removes the key from formData instead of setting it to an empty string. ([#4875](https://github.com/rjsf-team/react-jsonschema-form/pull/4875))

# 6.1.1

## @rjsf/core
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/templates/BaseInputTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function BaseInputTemplate<
const handleChange = useCallback(
(e: ChangeEvent<HTMLInputElement>) => {
const handler = onChangeOverride ? onChangeOverride : onChange;
const value = e.target.value === '' ? (options.emptyValue ?? '') : e.target.value;
const value = e.target.value === '' ? options.emptyValue : e.target.value;
handler(value);
},
[onChange, onChangeOverride, options],
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/widgets/PasswordWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function PasswordWidget<
onFocus,
} = props;

const emptyValue = options.emptyValue || '';
const emptyValue = options.emptyValue;
const themeProps = cleanupOptions(options);

const handleChange = useCallback(
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/widgets/TextareaWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function TextareaWidget<
} = props;

const themeProps = cleanupOptions(options);
const emptyValue = options?.emptyValue ?? '';
const emptyValue = options?.emptyValue;

const handleChange = useCallback(
(e: ChangeEvent<HTMLTextAreaElement>) => {
Expand Down
Loading