@@ -75,7 +75,7 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
75
75
const findEmailAddress = React . useCallback (
76
76
async ( value : string , isEnter ?: boolean ) => {
77
77
const validEmails : string [ ] = [ ] ;
78
- let inputValue = '' ;
78
+ let _inputValue = '' ;
79
79
const re = new RegExp ( delimiter , 'g' ) ;
80
80
const isEmail = validateEmail || isEmailFn ;
81
81
@@ -110,13 +110,13 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
110
110
addEmails ( '' + email ) ;
111
111
} else {
112
112
if ( arr . length === 1 ) {
113
- inputValue = '' + arr . shift ( ) ;
113
+ _inputValue = '' + arr . shift ( ) ;
114
114
} else {
115
115
arr . shift ( ) ;
116
116
}
117
117
}
118
118
} else {
119
- inputValue = '' + arr . shift ( ) ;
119
+ _inputValue = '' + arr . shift ( ) ;
120
120
}
121
121
}
122
122
} else {
@@ -127,7 +127,7 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
127
127
setSpinning ( false ) ;
128
128
} else {
129
129
if ( arr . length === 1 ) {
130
- inputValue = '' + arr . shift ( ) ;
130
+ _inputValue = '' + arr . shift ( ) ;
131
131
} else {
132
132
arr . shift ( ) ;
133
133
}
@@ -152,36 +152,36 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
152
152
const email = stripDisplayName ? value . split ( '<' ) [ 1 ] . split ( '>' ) [ 0 ] : value ;
153
153
addEmails ( email ) ;
154
154
} else {
155
- inputValue = value ;
155
+ _inputValue = value ;
156
156
}
157
157
} else {
158
- inputValue = value ;
158
+ _inputValue = value ;
159
159
}
160
160
} else {
161
161
// handle promise
162
162
setSpinning ( true ) ;
163
163
if ( ( await validateEmail ?.( value ) ) === true ) {
164
164
addEmails ( value ) ;
165
165
} else {
166
- inputValue = value ;
166
+ _inputValue = value ;
167
167
}
168
168
setSpinning ( false ) ;
169
169
}
170
170
} else {
171
- inputValue = value ;
171
+ _inputValue = value ;
172
172
}
173
173
}
174
174
}
175
175
176
176
setEmails ( [ ...emails , ...validEmails ] ) ;
177
- setInpValue ( inputValue ) ;
177
+ setInpValue ( _inputValue ) ;
178
178
179
179
if ( validEmails . length ) {
180
180
onChange ?.( [ ...emails , ...validEmails ] ) ;
181
181
}
182
182
183
- if ( inputValue !== inputValue ) {
184
- onChangeInput ?.( inputValue ) ;
183
+ if ( inputValue !== _inputValue ) {
184
+ onChangeInput ?.( _inputValue ) ;
185
185
}
186
186
} ,
187
187
[
@@ -190,6 +190,7 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
190
190
delimiter ,
191
191
emails ,
192
192
enable ,
193
+ inputValue ,
193
194
onChange ,
194
195
onChangeInput ,
195
196
onDisabled ,
@@ -201,9 +202,8 @@ export function ReactMultiEmail(props: IReactMultiEmailProps) {
201
202
const onChangeInputValue = React . useCallback (
202
203
async ( value : string ) => {
203
204
await findEmailAddress ( value ) ;
204
- onChangeInput ?.( value ) ;
205
205
} ,
206
- [ findEmailAddress , onChangeInput ] ,
206
+ [ findEmailAddress ] ,
207
207
) ;
208
208
209
209
const removeEmail = React . useCallback (
0 commit comments