TF-2475 Handle format style rich text in composer

This commit is contained in:
dab246
2024-01-30 02:51:54 +07:00
committed by Dat H. Pham
parent cd5c240401
commit e139e1ec94
8 changed files with 68 additions and 60 deletions
@@ -454,8 +454,7 @@ class ComposerController extends BaseController with DragDropFileMixin {
richTextMobileTabletController?.richTextController.onCreateHTMLEditor(
editorApi,
onEnterKeyDown: _onEnterKeyDown,
context: context,
onFocus: _onEditorFocusOnMobile,
onFocus: () => _onEditorFocusOnMobile(context),
onChangeCursor: (coordinates) {
_onChangeCursorOnMobile(coordinates, context);
},
@@ -1319,7 +1318,6 @@ class ComposerController extends BaseController with DragDropFileMixin {
log('ComposerController::clearFocus:');
if (PlatformInfo.isMobile) {
htmlEditorApi?.unfocus();
KeyboardUtils.hideSystemKeyboardMobile();
}
FocusScope.of(context).unfocus();
}
@@ -1508,7 +1506,7 @@ class ComposerController extends BaseController with DragDropFileMixin {
}
_closeSuggestionBox();
if (PlatformInfo.isMobile) {
htmlEditorApi?.unfocus();
richTextMobileTabletController?.richTextController.hideRichTextView();
}
} else {
switch(prefixEmailAddress) {
@@ -1647,7 +1645,13 @@ class ComposerController extends BaseController with DragDropFileMixin {
_closeComposerAction();
}
void _onEditorFocusOnMobile() {
Future<void> _onEditorFocusOnMobile(BuildContext context) async {
if (PlatformInfo.isAndroid) {
FocusScope.of(context).unfocus();
await Future.delayed(
const Duration(milliseconds: 300),
richTextMobileTabletController?.richTextController.showDeviceKeyboard);
}
_collapseAllRecipient();
_autoCreateEmailTag();
}