Fix auto create tag email when focus body composer on mobile
This commit is contained in:
@@ -1149,27 +1149,27 @@ class ComposerController extends BaseController {
|
||||
void onSubjectEmailFocusChange(bool isFocus) {
|
||||
log('ComposerController::onSubjectEmailFocusChange(): Focus: $isFocus');
|
||||
if (isFocus) {
|
||||
toAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
_collapseAllRecipient();
|
||||
htmlEditorApi?.unfocus();
|
||||
|
||||
autoCreateEmailTag();
|
||||
_autoCreateEmailTag();
|
||||
}
|
||||
}
|
||||
|
||||
void onEditorFocusChange(bool isFocus) {
|
||||
log('ComposerController::onEditorFocusChange(): Focus: $isFocus');
|
||||
if (isFocus) {
|
||||
toAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
|
||||
autoCreateEmailTag();
|
||||
_collapseAllRecipient();
|
||||
_autoCreateEmailTag();
|
||||
}
|
||||
}
|
||||
|
||||
void autoCreateEmailTag() {
|
||||
void _collapseAllRecipient() {
|
||||
toAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
}
|
||||
|
||||
void _autoCreateEmailTag() {
|
||||
final inputToEmail = toEmailAddressController.text;
|
||||
final inputCcEmail = ccEmailAddressController.text;
|
||||
final inputBccEmail = bccEmailAddressController.text;
|
||||
@@ -1203,6 +1203,7 @@ class ComposerController extends BaseController {
|
||||
isInitialRecipient.refresh();
|
||||
_updateStatusEmailSendButton();
|
||||
}
|
||||
log('ComposerController::_autoCreateToEmailTag(): STATE: ${keyToEmailTagEditor.currentState}');
|
||||
keyToEmailTagEditor.currentState?.resetTextField();
|
||||
Future.delayed(const Duration(milliseconds: 300), () {
|
||||
keyToEmailTagEditor.currentState?.closeSuggestionBox();
|
||||
@@ -1287,6 +1288,11 @@ class ComposerController extends BaseController {
|
||||
break;
|
||||
}
|
||||
_closeSuggestionBox();
|
||||
} else {
|
||||
if (!BuildUtils.isWeb) {
|
||||
_collapseAllRecipient();
|
||||
_autoCreateEmailTag();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -356,6 +356,7 @@ class ComposerView extends GetWidget<ComposerController>
|
||||
controller: controller.toEmailAddressController,
|
||||
focusNode: controller.toAddressFocusNode,
|
||||
autoDisposeFocusNode: false,
|
||||
keyTagEditor: controller.keyToEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value)
|
||||
..addOnFocusEmailAddressChangeAction((prefixEmailAddress, focus) => controller.onEmailAddressFocusChange(prefixEmailAddress, focus))
|
||||
..addOnShowFullListEmailAddressAction((prefixEmailAddress) => controller.showFullEmailAddress(prefixEmailAddress))
|
||||
@@ -376,6 +377,7 @@ class ComposerView extends GetWidget<ComposerController>
|
||||
controller.listEmailAddressType,
|
||||
expandMode: controller.ccAddressExpandMode.value,
|
||||
controller: controller.ccEmailAddressController,
|
||||
keyTagEditor: controller.keyCcEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,)
|
||||
..addOnFocusEmailAddressChangeAction((prefixEmailAddress, focus) => controller.onEmailAddressFocusChange(prefixEmailAddress, focus))
|
||||
..addOnShowFullListEmailAddressAction((prefixEmailAddress) => controller.showFullEmailAddress(prefixEmailAddress))
|
||||
@@ -397,6 +399,7 @@ class ComposerView extends GetWidget<ComposerController>
|
||||
controller.listEmailAddressType,
|
||||
expandMode: controller.bccAddressExpandMode.value,
|
||||
controller: controller.bccEmailAddressController,
|
||||
keyTagEditor: controller.keyBccEmailTagEditor,
|
||||
isInitial: controller.isInitialRecipient.value,)
|
||||
..addOnFocusEmailAddressChangeAction((prefixEmailAddress, focus) => controller.onEmailAddressFocusChange(prefixEmailAddress, focus))
|
||||
..addOnShowFullListEmailAddressAction((prefixEmailAddress) => controller.showFullEmailAddress(prefixEmailAddress))
|
||||
|
||||
Reference in New Issue
Block a user