diff --git a/app/assets/javascripts/users_select.js b/app/assets/javascripts/users_select.js index e19bbbacf4d..b9dfa22dd49 100644 --- a/app/assets/javascripts/users_select.js +++ b/app/assets/javascripts/users_select.js @@ -592,7 +592,7 @@ function UsersSelect(currentUser, els, options = {}) { if (showEmailUser && data.results.length === 0 && query.term.match(/^[^@]+@[^@]+$/)) { var trimmed = query.term.trim(); emailUser = { - name: "Invite \"" + query.term + "\" by email", + name: "Invite \"" + trimmed + "\" by email", username: trimmed, id: trimmed, invite: true diff --git a/changelogs/unreleased/52194-trim-extra-whitespace-invite-member.yml b/changelogs/unreleased/52194-trim-extra-whitespace-invite-member.yml new file mode 100644 index 00000000000..d96c2bc7acd --- /dev/null +++ b/changelogs/unreleased/52194-trim-extra-whitespace-invite-member.yml @@ -0,0 +1,5 @@ +--- +title: Trim whitespace when inviting a new user by email +merge_request: 22119 +author: Jacopo Beschi @jacopo-beschi +type: fixed