mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-06-27 18:10:54 +00:00
Add automatic trimming for domain names and forward host fields
This commit is contained in:
parent
7b3c1fd061
commit
c25c4e2c7e
2 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue