TF-2336 Fix jumping screen when clicking on Cc, Bcc

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 376836017243e803ae056c085a2a0fb3756e2b15)
This commit is contained in:
dab246
2023-11-22 15:34:31 +07:00
committed by Dat H. Pham
parent 662a0f33f2
commit e0cf8272cf
6 changed files with 107 additions and 81 deletions
@@ -1699,18 +1699,12 @@ class ComposerController extends BaseController {
switch(prefixEmailAddress) {
case PrefixEmailAddress.to:
toAddressExpandMode.value = ExpandMode.EXPAND;
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
break;
case PrefixEmailAddress.cc:
ccAddressExpandMode.value = ExpandMode.EXPAND;
toAddressExpandMode.value = ExpandMode.COLLAPSE;
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
break;
case PrefixEmailAddress.bcc:
bccAddressExpandMode.value = ExpandMode.EXPAND;
toAddressExpandMode.value = ExpandMode.COLLAPSE;
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
break;
default:
break;
@@ -1720,9 +1714,30 @@ class ComposerController extends BaseController {
htmlEditorApi?.unfocus();
}
} else {
if (PlatformInfo.isMobile) {
_collapseAllRecipient();
_autoCreateEmailTag();
switch(prefixEmailAddress) {
case PrefixEmailAddress.to:
toAddressExpandMode.value = ExpandMode.COLLAPSE;
final inputToEmail = toEmailAddressController.text;
if (inputToEmail.isNotEmpty) {
_autoCreateToEmailTag(inputToEmail);
}
break;
case PrefixEmailAddress.cc:
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
final inputCcEmail = ccEmailAddressController.text;
if (inputCcEmail.isNotEmpty) {
_autoCreateCcEmailTag(inputCcEmail);
}
break;
case PrefixEmailAddress.bcc:
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
final inputBccEmail = bccEmailAddressController.text;
if (inputBccEmail.isNotEmpty) {
_autoCreateBccEmailTag(inputBccEmail);
}
break;
default:
break;
}
}
}