TF-2623 Fix blink blink when user click on recipients field in an email with long recipients
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -297,6 +297,10 @@ class ComposerController extends BaseController {
|
|||||||
if (isSendEmailLoading.isTrue) {
|
if (isSendEmailLoading.isTrue) {
|
||||||
isSendEmailLoading.value = false;
|
isSendEmailLoading.value = false;
|
||||||
}
|
}
|
||||||
|
} else if (failure is GetAllIdentitiesFailure) {
|
||||||
|
if (identitySelected.value == null) {
|
||||||
|
_autoFocusFieldWhenLauncher();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,8 +528,6 @@ class ComposerController extends BaseController {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_autoFocusFieldWhenLauncher();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initSubjectEmail({
|
void _initSubjectEmail({
|
||||||
@@ -557,12 +559,12 @@ class ComposerController extends BaseController {
|
|||||||
final listIdentitiesMayDeleted = success.identities?.toListMayDeleted() ?? [];
|
final listIdentitiesMayDeleted = success.identities?.toListMayDeleted() ?? [];
|
||||||
if (listIdentitiesMayDeleted.isNotEmpty) {
|
if (listIdentitiesMayDeleted.isNotEmpty) {
|
||||||
listFromIdentities.value = listIdentitiesMayDeleted;
|
listFromIdentities.value = listIdentitiesMayDeleted;
|
||||||
await _selectIdentity(listIdentitiesMayDeleted.first);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fromRecipientState.value == PrefixRecipientState.disabled) {
|
if (identitySelected.value == null) {
|
||||||
_autoFocusFieldWhenLauncher();
|
await _selectIdentity(listIdentitiesMayDeleted.first);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
_autoFocusFieldWhenLauncher();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _initEmailAddress({
|
void _initEmailAddress({
|
||||||
@@ -1435,12 +1437,14 @@ class ComposerController extends BaseController {
|
|||||||
mailboxDashBoardController.closeComposerOverlay(result: result);
|
mailboxDashBoardController.closeComposerOverlay(result: result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayScreenTypeComposerAction(ScreenDisplayMode displayMode) {
|
void displayScreenTypeComposerAction(ScreenDisplayMode displayMode) async {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
|
||||||
createFocusNodeInput();
|
createFocusNodeInput();
|
||||||
_updateTextForEditor();
|
_updateTextForEditor();
|
||||||
screenDisplayMode.value = displayMode;
|
screenDisplayMode.value = displayMode;
|
||||||
_autoFocusFieldWhenLauncher();
|
|
||||||
|
await Future.delayed(
|
||||||
|
const Duration(milliseconds: 300),
|
||||||
|
_autoFocusFieldWhenLauncher);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _updateTextForEditor() async {
|
void _updateTextForEditor() async {
|
||||||
@@ -1886,20 +1890,30 @@ class ComposerController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _autoFocusFieldWhenLauncher() {
|
void _autoFocusFieldWhenLauncher() {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
if (_hasInputFieldFocused) {
|
||||||
|
log('ComposerController::_autoFocusFieldWhenLauncher: INPUT_FIELD_FOCUS = true');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FocusManager.instance.primaryFocus?.hasFocus == true) {
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
|
}
|
||||||
|
|
||||||
if (listToEmailAddress.isEmpty) {
|
if (listToEmailAddress.isEmpty) {
|
||||||
toAddressFocusNode?.requestFocus();
|
toAddressFocusNode?.requestFocus();
|
||||||
} else if (subjectEmailInputController.text.isEmpty) {
|
} else if (subjectEmailInputController.text.isEmpty) {
|
||||||
subjectEmailInputFocusNode?.requestFocus();
|
subjectEmailInputFocusNode?.requestFocus();
|
||||||
} else if (PlatformInfo.isWeb) {
|
} else if (PlatformInfo.isWeb) {
|
||||||
Future.delayed(
|
richTextWebController.editorController.setFocus();
|
||||||
const Duration(milliseconds: 500),
|
|
||||||
richTextWebController.editorController.setFocus
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get _hasInputFieldFocused =>
|
||||||
|
toAddressFocusNode?.hasFocus == true ||
|
||||||
|
ccAddressFocusNode?.hasFocus == true ||
|
||||||
|
bccAddressFocusNode?.hasFocus == true ||
|
||||||
|
subjectEmailInputFocusNode?.hasFocus == true;
|
||||||
|
|
||||||
void handleInitHtmlEditorWeb(String initContent) {
|
void handleInitHtmlEditorWeb(String initContent) {
|
||||||
richTextWebController.editorController.setFullScreen();
|
richTextWebController.editorController.setFullScreen();
|
||||||
onChangeTextEditorWeb(initContent);
|
onChangeTextEditorWeb(initContent);
|
||||||
@@ -1911,9 +1925,7 @@ class ComposerController extends BaseController {
|
|||||||
|
|
||||||
void handleOnFocusHtmlEditorWeb() {
|
void handleOnFocusHtmlEditorWeb() {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
Future.delayed(const Duration(milliseconds: 500), () {
|
richTextWebController.editorController.setFocus();
|
||||||
richTextWebController.editorController.setFocus();
|
|
||||||
});
|
|
||||||
richTextWebController.closeAllMenuPopup();
|
richTextWebController.closeAllMenuPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user