From c3033bd6e84fa0ef8bd1d90e2b314749fc133875 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Sat, 17 Sep 2022 23:09:14 +0800 Subject: [PATCH] fix: few UI/usability issues with the time input field --- .../lib/plugins/grid/application/cell/date_cal_bloc.dart | 2 +- .../grid/presentation/widgets/cell/date_cell/date_editor.dart | 1 + .../field/type_options/date_type_option/date_type_option.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart index 1dcc74f196..0deee8098c 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/date_cal_bloc.dart @@ -108,7 +108,7 @@ class DateCalBloc extends Bloc { (err) { switch (ErrorCode.valueOf(err.code)!) { case ErrorCode.InvalidDateTimeFormat: - updateCalData(none(), Some(timeFormatPrompt(err))); + updateCalData(state.calData, Some(timeFormatPrompt(err))); break; default: Log.error(err); diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart index cc502f9cf9..f40380cd34 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart @@ -261,6 +261,7 @@ class _TimeTextFieldState extends State<_TimeTextField> { child: RoundedInputField( height: 40, focusNode: _focusNode, + autoFocus: true, hintText: state.timeHintText, controller: _controller, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500), diff --git a/frontend/rust-lib/flowy-grid/src/services/field/type_options/date_type_option/date_type_option.rs b/frontend/rust-lib/flowy-grid/src/services/field/type_options/date_type_option/date_type_option.rs index eaf6764378..e79ae3574c 100644 --- a/frontend/rust-lib/flowy-grid/src/services/field/type_options/date_type_option/date_type_option.rs +++ b/frontend/rust-lib/flowy-grid/src/services/field/type_options/date_type_option/date_type_option.rs @@ -52,7 +52,7 @@ impl DateTypeOptionPB { let mut time = "".to_string(); if has_time && self.include_time { - let fmt = format!("{} {}", self.date_format.format_str(), self.time_format.format_str()); + let fmt = format!("{}{}", self.date_format.format_str(), self.time_format.format_str()); time = format!("{}", utc.format_with_items(StrftimeItems::new(&fmt))).replace(&date, ""); }