Browse Source

fix(mobile): first char miss in new description (#4697)

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
shenlong 1 year ago
parent
commit
b117985f66
1 changed files with 8 additions and 1 deletions
  1. 8 1
      mobile/lib/modules/asset_viewer/ui/description_input.dart

+ 8 - 1
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;