Skip to content

Commit f8aab9f

Browse files
committed
Fix: Align Mantine’s behavior with other themes when clearing string fields
1 parent a62510d commit f8aab9f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/mantine/src/templates/BaseInputTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function BaseInputTemplate<
5555
const handleChange = useCallback(
5656
(e: ChangeEvent<HTMLInputElement>) => {
5757
const handler = onChangeOverride ? onChangeOverride : onChange;
58-
const value = e.target.value === '' ? (options.emptyValue ?? '') : e.target.value;
58+
const value = e.target.value === '' ? options.emptyValue : e.target.value;
5959
handler(value);
6060
},
6161
[onChange, onChangeOverride, options],

packages/mantine/src/widgets/PasswordWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function PasswordWidget<
3939
onFocus,
4040
} = props;
4141

42-
const emptyValue = options.emptyValue || '';
42+
const emptyValue = options.emptyValue;
4343
const themeProps = cleanupOptions(options);
4444

4545
const handleChange = useCallback(

packages/mantine/src/widgets/TextareaWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function TextareaWidget<
4040
} = props;
4141

4242
const themeProps = cleanupOptions(options);
43-
const emptyValue = options?.emptyValue ?? '';
43+
const emptyValue = options?.emptyValue;
4444

4545
const handleChange = useCallback(
4646
(e: ChangeEvent<HTMLTextAreaElement>) => {

0 commit comments

Comments
 (0)