Skip to content

Commit

Permalink
TF-1486 Fix duplicate cursor in vacation on android
Browse files Browse the repository at this point in the history
(cherry picked from commit c0532ec)
  • Loading branch information
dab246 committed Jul 14, 2023
1 parent 15df142 commit 38442aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class VacationController extends BaseController {
final errorMessageBody = Rxn<String>();

final subjectTextController = TextEditingController();
final subjectTextFocusNode = FocusNode();
final richTextControllerForMobile = RichTextController();
final htmlEditorMinHeight = 150;

Expand Down Expand Up @@ -338,6 +339,8 @@ class VacationController extends BaseController {
}

void onFocusHTMLEditor() async {
subjectTextFocusNode.unfocus();

await Scrollable.ensureVisible(htmlKey.currentContext!);
await Future.delayed(const Duration(milliseconds: 500), () {
scrollController.animateTo(
Expand All @@ -360,6 +363,7 @@ class VacationController extends BaseController {

@override
void onClose() {
subjectTextFocusNode.dispose();
subjectTextController.dispose();
richTextControllerForMobile.dispose();
scrollController.dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
child: TextInputFieldBuilder(
label: AppLocalizations.of(context).subject,
hint: AppLocalizations.of(context).hintSubjectInputVacationSetting,
editingController: controller.subjectTextController
editingController: controller.subjectTextController,
focusNode: controller.subjectTextFocusNode,
),
)
: Row(children: [
Expand All @@ -260,7 +261,8 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
child: TextInputFieldBuilder(
label: AppLocalizations.of(context).subject,
hint: AppLocalizations.of(context).hintSubjectInputVacationSetting,
editingController: controller.subjectTextController
editingController: controller.subjectTextController,
focusNode: controller.subjectTextFocusNode,
),
)),
const SizedBox(width: 24),
Expand Down

0 comments on commit 38442aa

Please sign in to comment.