From b117985f667fce5f227460be7a72ecb8e5acf0a7 Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Sun, 29 Oct 2023 19:16:25 +0000 Subject: [PATCH] fix(mobile): first char miss in new description (#4697) Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- .../lib/modules/asset_viewer/ui/description_input.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mobile/lib/modules/asset_viewer/ui/description_input.dart b/mobile/lib/modules/asset_viewer/ui/description_input.dart index cc459d4732..e00739faf8 100644 --- a/mobile/lib/modules/asset_viewer/ui/description_input.dart +++ b/mobile/lib/modules/asset_viewer/ui/description_input.dart @@ -31,7 +31,14 @@ class DescriptionInput extends HookConsumerWidget { final owner = ref.watch(currentUserProvider); final hasError = useState(false); - controller.text = description; + useEffect( + () { + controller.text = description; + isTextEmpty.value = description.isEmpty; + return null; + }, + [description], + ); submitDescription(String description) async { hasError.value = false;