Skip to content

Commit ab75975

Browse files
committed
fix: When the input box's type is set to number, the result is forcibly converted to the number type. #1425
1 parent d67c7e2 commit ab75975

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ui/src/components/SchemaForm/components/Input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const Index: FC<Props> = ({
6464
...formData,
6565
[name]: {
6666
...formData[name],
67-
value,
67+
value: type === 'number' ? Number(value) : value,
6868
isInvalid: false,
6969
},
7070
};

ui/src/pages/Admin/Smtp/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const Smtp: FC = () => {
5959
enumNames: ['TLS', 'SSL', 'None'],
6060
},
6161
smtp_port: {
62-
type: 'string',
62+
type: 'number',
6363
title: t('smtp_port.label'),
6464
description: t('smtp_port.text'),
6565
},
@@ -160,7 +160,7 @@ const Smtp: FC = () => {
160160
from_name: formData.from_name.value,
161161
smtp_host: formData.smtp_host.value,
162162
encryption: formData.encryption.value,
163-
smtp_port: Number(formData.smtp_port.value),
163+
smtp_port: formData.smtp_port.value,
164164
smtp_authentication: formData.smtp_authentication.value,
165165
...(formData.smtp_authentication.value
166166
? { smtp_username: formData.smtp_username.value }

0 commit comments

Comments
 (0)