From 8748d4448ff4b6fc7203497ec0c1552cd9669ef8 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 1 Sep 2022 08:40:19 +0100 Subject: [PATCH] Add trimming to AddUserModal --- .../portal/manage/users/_components/AddUserModal.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte index ced45db687..0c02eec4e9 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte @@ -44,7 +44,11 @@ ] } - function validateInput(email, index) { + function validateInput(input, index) { + if (input.email) { + input.email = input.email.trim() + } + const email = input.email if (email) { const res = emailValidator(email) if (res === true) { @@ -95,7 +99,7 @@ bind:dropdownValue={input.role} options={Constants.BudibaseRoleOptions} error={input.error} - on:blur={() => validateInput(input.email, index)} + on:blur={() => validateInput(input, index)} />