From 74ac94e227e2879cbd1683252ce7b90b104e9418 Mon Sep 17 00:00:00 2001 From: DatDang Date: Wed, 4 Dec 2024 14:24:39 +0700 Subject: [PATCH] Hotfix identity creator view bug (cherry picked from commit 5094fd43dd37816590dec476cfc73c58b80b6c70) --- .../presentation/identity_creator_view.dart | 14 +++-- .../presentation/vacation/vacation_view.dart | 51 ++++++++++--------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/lib/features/identity_creator/presentation/identity_creator_view.dart b/lib/features/identity_creator/presentation/identity_creator_view.dart index 2d633c0e0..f9c8ac6ec 100644 --- a/lib/features/identity_creator/presentation/identity_creator_view.dart +++ b/lib/features/identity_creator/presentation/identity_creator_view.dart @@ -472,10 +472,16 @@ class IdentityCreatorView extends GetWidget ), ] ), - _buildHtmlEditorWeb( - context, - controller.contentHtmlEditor, - maxWidth), + ConstrainedBox( + constraints: BoxConstraints( + maxWidth: maxWidth, + maxHeight: 300, + ), + child: _buildHtmlEditorWeb( + context, + controller.contentHtmlEditor, + maxWidth), + ), ], ); } else { diff --git a/lib/features/manage_account/presentation/vacation/vacation_view.dart b/lib/features/manage_account/presentation/vacation/vacation_view.dart index a27451ef6..8fd9dba19 100644 --- a/lib/features/manage_account/presentation/vacation/vacation_view.dart +++ b/lib/features/manage_account/presentation/vacation/vacation_view.dart @@ -477,30 +477,33 @@ class VacationView extends GetWidget with RichTextButtonMixi Widget _buildMessageHtmlTextEditor(BuildContext context) { if (PlatformInfo.isWeb) { - return html_editor_browser.HtmlEditor( - key: const Key('vacation_message_html_text_editor_web'), - controller: controller.richTextControllerForWeb.editorController, - htmlEditorOptions: html_editor_browser.HtmlEditorOptions( - hint: '', - darkMode: false, - initialText: controller.vacationMessageHtmlText, - spellCheck: true, - customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(direction: AppUtils.getCurrentDirection(context)) - ), - htmlToolbarOptions: const html_editor_browser.HtmlToolbarOptions( - toolbarType: html_editor_browser.ToolbarType.hide, - defaultToolbarButtons: []), - otherOptions: const html_editor_browser.OtherOptions(height: 150), - callbacks: html_editor_browser.Callbacks( - onChangeSelection: controller.richTextControllerForWeb.onEditorSettingsChange, - onChangeContent: controller.updateMessageHtmlText, - onFocus: () { - KeyboardUtils.hideKeyboard(context); - Future.delayed(const Duration(milliseconds: 500), () { - controller.richTextControllerForWeb.editorController.setFocus(); - }); - controller.richTextControllerForWeb.closeAllMenuPopup(); - } + return ConstrainedBox( + constraints: const BoxConstraints(maxHeight: 300), + child: html_editor_browser.HtmlEditor( + key: const Key('vacation_message_html_text_editor_web'), + controller: controller.richTextControllerForWeb.editorController, + htmlEditorOptions: html_editor_browser.HtmlEditorOptions( + hint: '', + darkMode: false, + initialText: controller.vacationMessageHtmlText, + spellCheck: true, + customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(direction: AppUtils.getCurrentDirection(context)) + ), + htmlToolbarOptions: const html_editor_browser.HtmlToolbarOptions( + toolbarType: html_editor_browser.ToolbarType.hide, + defaultToolbarButtons: []), + otherOptions: const html_editor_browser.OtherOptions(height: 150), + callbacks: html_editor_browser.Callbacks( + onChangeSelection: controller.richTextControllerForWeb.onEditorSettingsChange, + onChangeContent: controller.updateMessageHtmlText, + onFocus: () { + KeyboardUtils.hideKeyboard(context); + Future.delayed(const Duration(milliseconds: 500), () { + controller.richTextControllerForWeb.editorController.setFocus(); + }); + controller.richTextControllerForWeb.closeAllMenuPopup(); + } + ), ), ); } else {