TF-795 [Web] Fix customizing style in composer unselect the composer widget

This commit is contained in:
dab246
2022-08-09 12:26:41 +07:00
committed by Dat H. Pham
parent 871b40a968
commit 1f9c2333af
@@ -88,6 +88,7 @@ class RichTextWebController extends BaseRichTextController {
editorController.execCommand( editorController.execCommand(
textStyleType.commandAction, textStyleType.commandAction,
argument: colorAsString); argument: colorAsString);
editorController.setFocus();
}, },
onSelectColor: (selectedColor) { onSelectColor: (selectedColor) {
final newColor = selectedColor ?? Colors.black; final newColor = selectedColor ?? Colors.black;
@@ -100,6 +101,7 @@ class RichTextWebController extends BaseRichTextController {
editorController.execCommand( editorController.execCommand(
textStyleType.commandAction, textStyleType.commandAction,
argument: colorAsString); argument: colorAsString);
editorController.setFocus();
} }
); );
break; break;
@@ -117,6 +119,7 @@ class RichTextWebController extends BaseRichTextController {
editorController.execCommand( editorController.execCommand(
textStyleType.commandAction, textStyleType.commandAction,
argument: colorAsString); argument: colorAsString);
editorController.setFocus();
}, },
onSelectColor: (selectedColor) { onSelectColor: (selectedColor) {
final newColor = selectedColor ?? Colors.white; final newColor = selectedColor ?? Colors.white;
@@ -129,12 +132,14 @@ class RichTextWebController extends BaseRichTextController {
editorController.execCommand( editorController.execCommand(
textStyleType.commandAction, textStyleType.commandAction,
argument: colorAsString); argument: colorAsString);
editorController.setFocus();
} }
); );
break; break;
default: default:
editorController.execCommand(textStyleType.commandAction); editorController.execCommand(textStyleType.commandAction);
_selectTextStyleType(textStyleType); _selectTextStyleType(textStyleType);
editorController.setFocus();
break; break;
} }
} }
@@ -165,6 +170,7 @@ class RichTextWebController extends BaseRichTextController {
editorController.execCommand( editorController.execCommand(
RichTextStyleType.fontName.commandAction, RichTextStyleType.fontName.commandAction,
argument: fontSelected.fontFamily); argument: fontSelected.fontFamily);
editorController.setFocus();
} }
bool get isMenuFontOpen => menuFontStatus.value == DropdownMenuFontStatus.open; bool get isMenuFontOpen => menuFontStatus.value == DropdownMenuFontStatus.open;
@@ -210,12 +216,14 @@ class RichTextWebController extends BaseRichTextController {
editorController.execCommand( editorController.execCommand(
RichTextStyleType.headerStyle.commandAction, RichTextStyleType.headerStyle.commandAction,
argument: styleSelected.styleValue); argument: styleSelected.styleValue);
editorController.setFocus();
} }
void applyParagraphType(ParagraphType newParagraph) { void applyParagraphType(ParagraphType newParagraph) {
selectedParagraph.value = newParagraph; selectedParagraph.value = newParagraph;
editorController.execCommand(newParagraph.commandAction); editorController.execCommand(newParagraph.commandAction);
menuParagraphController.hideMenu(); menuParagraphController.hideMenu();
editorController.setFocus();
} }
void closeAllMenuPopup() { void closeAllMenuPopup() {
@@ -237,6 +245,7 @@ class RichTextWebController extends BaseRichTextController {
selectedOrderList.value = newOrderList; selectedOrderList.value = newOrderList;
editorController.execCommand(newOrderList.commandAction); editorController.execCommand(newOrderList.commandAction);
menuOrderListController.hideMenu(); menuOrderListController.hideMenu();
editorController.setFocus();
} }
@override @override