Add automatic trimming for domain names and forward host fields

This commit is contained in:
vishnugt 2026-01-15 03:59:24 +05:30
parent 7b3c1fd061
commit c25c4e2c7e
2 changed files with 5 additions and 1 deletions

View file

@ -33,7 +33,7 @@ export function DomainNamesField({
const handleChange = (v: MultiValue<SelectOption>, _actionMeta: ActionMeta<SelectOption>) => {
const doms = v?.map((i: SelectOption) => {
return i.value;
return i.value.trim();
});
setFieldValue(name, doms);
onChange?.(doms);

View file

@ -209,6 +209,10 @@ const ProxyHostModal = EasyModal.create(({ id, visible, remove }: Props) => {
required
placeholder="example.com"
{...field}
onChange={(e) => {
const trimmed = e.target.value.trim();
field.onChange({ ...e, target: { ...e.target, value: trimmed } });
}}
/>
{form.errors.forwardHost ? (
<div className="invalid-feedback">