fix: paste event on existing text

This commit is contained in:
sreehari jayaraj
2023-09-22 15:26:16 +00:00
parent eeb74a0eec
commit 39b4e09aff
2 changed files with 6 additions and 0 deletions

View File

@@ -138,6 +138,9 @@ onKeyStroke('Backspace', () => {
const onPaste = (e: ClipboardEvent) => {
const pastedText = e.clipboardData?.getData('text')
const inputArray = pastedText?.split(',') || pastedText?.split(' ')
if (inputArray?.length === 1 && inviteData.email.length > 1) {
inputArray[0] = inviteData.email += inputArray[0]
}
inputArray?.forEach((el) => {
if (el.length < 1) {
emailValidation.isError = true