From 4ca3ba8e08ac6f780df2be467f661b0bc4ad3094 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Sat, 24 Feb 2024 22:55:35 +0800 Subject: [PATCH] fix: cjk input in calendar and row detail (#4726) --- .../calendar/presentation/calendar_event_editor.dart | 6 +++++- .../lib/plugins/database/widgets/row/row_banner.dart | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_event_editor.dart b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_event_editor.dart index cdef15c4d0..5258e32d62 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_event_editor.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/calendar/presentation/calendar_event_editor.dart @@ -268,7 +268,11 @@ class _TitleTextCellSkin extends IEditableTextCellSkin { textStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: 14), focusNode: focusNode, hintText: LocaleKeys.calendar_defaultNewCalendarTitle.tr(), - onChanged: (text) => bloc.add(TextCellEvent.updateText(text)), + onChanged: (text) { + if (textEditingController.value.composing.isCollapsed) { + bloc.add(TextCellEvent.updateText(text)); + } + }, ); } } diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_banner.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_banner.dart index 8cf9f868b7..9f620118e9 100644 --- a/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_banner.dart +++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/row/row_banner.dart @@ -302,7 +302,11 @@ class _TitleSkin extends IEditableTextCellSkin { isDense: true, isCollapsed: true, ), - onChanged: (text) => bloc.add(TextCellEvent.updateText(text.trim())), + onChanged: (text) { + if (textEditingController.value.composing.isCollapsed) { + bloc.add(TextCellEvent.updateText(text)); + } + }, ); } }