TF-939 Fix error Timer only run one time by init it every time select tag
This commit is contained in:
committed by
Dat H. Pham
parent
5f2c42004e
commit
18b2757c86
@@ -84,11 +84,7 @@ class EmailAddressInputBuilder {
|
||||
this.controller,
|
||||
this.expandMode = ExpandMode.EXPAND,
|
||||
}
|
||||
) {
|
||||
_gapBetweenTagChangedAndFindSuggestion = Timer(
|
||||
const Duration(seconds: 1),
|
||||
_handleGapBetweenTagChangedAndFindSuggestion);
|
||||
}
|
||||
);
|
||||
|
||||
Widget build() {
|
||||
return Row(
|
||||
@@ -197,6 +193,9 @@ class EmailAddressInputBuilder {
|
||||
setState(() => listEmailAddress.add(EmailAddress(null, value)));
|
||||
_onUpdateListEmailAddressAction?.call(_prefixEmailAddress, listEmailAddress);
|
||||
}
|
||||
_gapBetweenTagChangedAndFindSuggestion = Timer(
|
||||
const Duration(seconds: 1),
|
||||
_handleGapBetweenTagChangedAndFindSuggestion);
|
||||
},
|
||||
findSuggestions: _findSuggestions,
|
||||
searchAllSuggestions: () async {
|
||||
@@ -327,8 +326,8 @@ class EmailAddressInputBuilder {
|
||||
}
|
||||
|
||||
FutureOr<List<SuggestionEmailAddress>> _findSuggestions(String query) async {
|
||||
log('EmailAddressInputBuilder::_buildTagEditor(): findSuggestions: $query');
|
||||
if (_gapBetweenTagChangedAndFindSuggestion?.isActive ?? true) {
|
||||
if (_gapBetweenTagChangedAndFindSuggestion?.isActive ?? false) {
|
||||
log('EmailAddressInputBuilder::_findSuggestions(): return empty');
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user