This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git
The following commit(s) were added to refs/heads/test by this push:
new ab759755 fix: When the input box's type is set to number, the result
is forcibly converted to the number type. #1425
new c514731c Merge branch 'test' of github.com:apache/answer into test
ab759755 is described below
commit ab759755ecd6ddeaa86114d1d41edcb5c3cb749f
Author: shuai <[email protected]>
AuthorDate: Fri Dec 5 11:12:58 2025 +0800
fix: When the input box's type is set to number, the result is forcibly
converted to the number type. #1425
---
ui/src/components/SchemaForm/components/Input.tsx | 2 +-
ui/src/pages/Admin/Smtp/index.tsx | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/src/components/SchemaForm/components/Input.tsx
b/ui/src/components/SchemaForm/components/Input.tsx
index d84d7d55..a1838151 100644
--- a/ui/src/components/SchemaForm/components/Input.tsx
+++ b/ui/src/components/SchemaForm/components/Input.tsx
@@ -64,7 +64,7 @@ const Index: FC<Props> = ({
...formData,
[name]: {
...formData[name],
- value,
+ value: type === 'number' ? Number(value) : value,
isInvalid: false,
},
};
diff --git a/ui/src/pages/Admin/Smtp/index.tsx
b/ui/src/pages/Admin/Smtp/index.tsx
index cde274e3..85a1b976 100644
--- a/ui/src/pages/Admin/Smtp/index.tsx
+++ b/ui/src/pages/Admin/Smtp/index.tsx
@@ -59,7 +59,7 @@ const Smtp: FC = () => {
enumNames: ['TLS', 'SSL', 'None'],
},
smtp_port: {
- type: 'string',
+ type: 'number',
title: t('smtp_port.label'),
description: t('smtp_port.text'),
},
@@ -160,7 +160,7 @@ const Smtp: FC = () => {
from_name: formData.from_name.value,
smtp_host: formData.smtp_host.value,
encryption: formData.encryption.value,
- smtp_port: Number(formData.smtp_port.value),
+ smtp_port: formData.smtp_port.value,
smtp_authentication: formData.smtp_authentication.value,
...(formData.smtp_authentication.value
? { smtp_username: formData.smtp_username.value }