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.controller,
|
||||||
this.expandMode = ExpandMode.EXPAND,
|
this.expandMode = ExpandMode.EXPAND,
|
||||||
}
|
}
|
||||||
) {
|
);
|
||||||
_gapBetweenTagChangedAndFindSuggestion = Timer(
|
|
||||||
const Duration(seconds: 1),
|
|
||||||
_handleGapBetweenTagChangedAndFindSuggestion);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget build() {
|
Widget build() {
|
||||||
return Row(
|
return Row(
|
||||||
@@ -197,6 +193,9 @@ class EmailAddressInputBuilder {
|
|||||||
setState(() => listEmailAddress.add(EmailAddress(null, value)));
|
setState(() => listEmailAddress.add(EmailAddress(null, value)));
|
||||||
_onUpdateListEmailAddressAction?.call(_prefixEmailAddress, listEmailAddress);
|
_onUpdateListEmailAddressAction?.call(_prefixEmailAddress, listEmailAddress);
|
||||||
}
|
}
|
||||||
|
_gapBetweenTagChangedAndFindSuggestion = Timer(
|
||||||
|
const Duration(seconds: 1),
|
||||||
|
_handleGapBetweenTagChangedAndFindSuggestion);
|
||||||
},
|
},
|
||||||
findSuggestions: _findSuggestions,
|
findSuggestions: _findSuggestions,
|
||||||
searchAllSuggestions: () async {
|
searchAllSuggestions: () async {
|
||||||
@@ -327,8 +326,8 @@ class EmailAddressInputBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FutureOr<List<SuggestionEmailAddress>> _findSuggestions(String query) async {
|
FutureOr<List<SuggestionEmailAddress>> _findSuggestions(String query) async {
|
||||||
log('EmailAddressInputBuilder::_buildTagEditor(): findSuggestions: $query');
|
if (_gapBetweenTagChangedAndFindSuggestion?.isActive ?? false) {
|
||||||
if (_gapBetweenTagChangedAndFindSuggestion?.isActive ?? true) {
|
log('EmailAddressInputBuilder::_findSuggestions(): return empty');
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user