TF-1679: Support hide keyboard when click add email forward

(cherry picked from commit 3794508a5debc4069f58f0aa5fd4052fb844183c)
This commit is contained in:
HuyNguyen
2023-04-05 16:09:36 +07:00
committed by Dat Vu
parent abeaf07050
commit 008e36a811
@@ -280,6 +280,7 @@ class _AutocompleteContactTextFieldWithTagsState extends State<AutocompleteConta
color: Colors.white,
fontWeight: FontWeight.w500))
..onPressActionClick(() {
_hideKeyboardForMobile();
if (widget.controller?.text.isNotEmpty == true) {
if (!_isDuplicatedRecipient(widget.controller?.text ?? '')) {
setState(() {
@@ -315,4 +316,10 @@ class _AutocompleteContactTextFieldWithTagsState extends State<AutocompleteConta
keyToEmailTagEditor.currentState?.resetTextField();
keyToEmailTagEditor.currentState?.closeSuggestionBox();
}
void _hideKeyboardForMobile() {
if (!_responsiveUtils.isDesktop(context)) {
FocusScope.of(context).unfocus();
}
}
}