mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #3948 from overleaf/ae-invite-spaces
Remove spaces from invited email addresses GitOrigin-RevId: 034c4e7297561b9195248eb8a52cd1f800940b6d
This commit is contained in:
parent
c5a1368d30
commit
9e83c42200
1 changed files with 8 additions and 1 deletions
|
@ -7,6 +7,11 @@ import classnames from 'classnames'
|
||||||
|
|
||||||
import Icon from '../../../shared/components/icon'
|
import Icon from '../../../shared/components/icon'
|
||||||
|
|
||||||
|
// Unicode characters in these Unicode groups:
|
||||||
|
// "General Punctuation — Spaces"
|
||||||
|
// "General Punctuation — Format character" (including zero-width spaces)
|
||||||
|
const matchAllSpaces = /[\u061C\u2000-\u200F\u202A-\u202E\u2060\u2066-\u2069\u2028\u2029\u202F]/g
|
||||||
|
|
||||||
export default function SelectCollaborators({
|
export default function SelectCollaborators({
|
||||||
loading,
|
loading,
|
||||||
options,
|
options,
|
||||||
|
@ -98,7 +103,9 @@ export default function SelectCollaborators({
|
||||||
})
|
})
|
||||||
|
|
||||||
const addNewItem = useCallback(
|
const addNewItem = useCallback(
|
||||||
(email, focus = true) => {
|
(_email, focus = true) => {
|
||||||
|
const email = _email.replace(matchAllSpaces, '')
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isValidInput &&
|
isValidInput &&
|
||||||
email.includes('@') &&
|
email.includes('@') &&
|
||||||
|
|
Loading…
Reference in a new issue