Hotfix identity creator view bug

(cherry picked from commit 5094fd43dd37816590dec476cfc73c58b80b6c70)
This commit is contained in:
DatDang
2024-12-04 14:24:39 +07:00
committed by Dat H. Pham
parent 6b348edd0d
commit 74ac94e227
2 changed files with 37 additions and 28 deletions
@@ -472,10 +472,16 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController>
), ),
] ]
), ),
_buildHtmlEditorWeb( ConstrainedBox(
context, constraints: BoxConstraints(
controller.contentHtmlEditor, maxWidth: maxWidth,
maxWidth), maxHeight: 300,
),
child: _buildHtmlEditorWeb(
context,
controller.contentHtmlEditor,
maxWidth),
),
], ],
); );
} else { } else {
@@ -477,30 +477,33 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
Widget _buildMessageHtmlTextEditor(BuildContext context) { Widget _buildMessageHtmlTextEditor(BuildContext context) {
if (PlatformInfo.isWeb) { if (PlatformInfo.isWeb) {
return html_editor_browser.HtmlEditor( return ConstrainedBox(
key: const Key('vacation_message_html_text_editor_web'), constraints: const BoxConstraints(maxHeight: 300),
controller: controller.richTextControllerForWeb.editorController, child: html_editor_browser.HtmlEditor(
htmlEditorOptions: html_editor_browser.HtmlEditorOptions( key: const Key('vacation_message_html_text_editor_web'),
hint: '', controller: controller.richTextControllerForWeb.editorController,
darkMode: false, htmlEditorOptions: html_editor_browser.HtmlEditorOptions(
initialText: controller.vacationMessageHtmlText, hint: '',
spellCheck: true, darkMode: false,
customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(direction: AppUtils.getCurrentDirection(context)) initialText: controller.vacationMessageHtmlText,
), spellCheck: true,
htmlToolbarOptions: const html_editor_browser.HtmlToolbarOptions( customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(direction: AppUtils.getCurrentDirection(context))
toolbarType: html_editor_browser.ToolbarType.hide, ),
defaultToolbarButtons: []), htmlToolbarOptions: const html_editor_browser.HtmlToolbarOptions(
otherOptions: const html_editor_browser.OtherOptions(height: 150), toolbarType: html_editor_browser.ToolbarType.hide,
callbacks: html_editor_browser.Callbacks( defaultToolbarButtons: []),
onChangeSelection: controller.richTextControllerForWeb.onEditorSettingsChange, otherOptions: const html_editor_browser.OtherOptions(height: 150),
onChangeContent: controller.updateMessageHtmlText, callbacks: html_editor_browser.Callbacks(
onFocus: () { onChangeSelection: controller.richTextControllerForWeb.onEditorSettingsChange,
KeyboardUtils.hideKeyboard(context); onChangeContent: controller.updateMessageHtmlText,
Future.delayed(const Duration(milliseconds: 500), () { onFocus: () {
controller.richTextControllerForWeb.editorController.setFocus(); KeyboardUtils.hideKeyboard(context);
}); Future.delayed(const Duration(milliseconds: 500), () {
controller.richTextControllerForWeb.closeAllMenuPopup(); controller.richTextControllerForWeb.editorController.setFocus();
} });
controller.richTextControllerForWeb.closeAllMenuPopup();
}
),
), ),
); );
} else { } else {