[GH-ISSUE #1898] [Bug] Field Validation in Kanban Board #747

Closed
opened 2026-03-23 20:40:32 +00:00 by mirror · 5 comments
Owner

Originally created by @AmanNegi on GitHub (Feb 28, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1898

Originally assigned to: @AmanNegi on GitHub.

Bug Description

OS: Windows

Field Validation Issue

On the TODO page, we are able to add empty text. This should be fixed by adding basic input validation and trimming the input as well.

image

How to Reproduce

Download the released version of AppFlowy and try to add an empty item to the TODO list. This should add the empty item.

Expected Behavior

A toast should be shown suggesting the user to enter some text and then try.

Operating System

Windows

AppFlowy Version(s)

1.0.0

Screenshots

No response

Additional Context

No response

Originally created by @AmanNegi on GitHub (Feb 28, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/1898 Originally assigned to: @AmanNegi on GitHub. ### Bug Description > OS: Windows ## Field Validation Issue On the TODO page, we are able to add empty text. This should be fixed by adding basic input validation and trimming the input as well. ![image](https://user-images.githubusercontent.com/37607224/221749102-22190a72-dcc2-4176-88d9-4a041dcfc096.png) ### How to Reproduce Download the released version of AppFlowy and try to add an empty item to the TODO list. This should add the empty item. ### Expected Behavior A toast should be shown suggesting the user to enter some text and then try. ### Operating System Windows ### AppFlowy Version(s) 1.0.0 ### Screenshots _No response_ ### Additional Context _No response_
mirror 2026-03-23 20:40:32 +00:00
Author
Owner

@AmanNegi commented on GitHub (Feb 28, 2023):

I would love to fix this as well! 😊

<!-- gh-comment-id:1447544574 --> @AmanNegi commented on GitHub (Feb 28, 2023): I would love to fix this as well! 😊
Author
Owner

@annieappflowy commented on GitHub (Mar 2, 2023):

Assigned! Thank you ❤️

<!-- gh-comment-id:1451435112 --> @annieappflowy commented on GitHub (Mar 2, 2023): Assigned! Thank you ❤️
Author
Owner

@AmanNegi commented on GitHub (Mar 6, 2023):

Hey @LucasXu0 I am really confused how to do this, I am able to delete the document onEditComplete but I am not able to get the text and check if it's null/empty. Could you please guide me in this?

To Delete the Item, I am doing the following:

// board_page.dart
...
onEndEditing: (){
     // TODO: Check if the field is empty

     // Deleting the Item
      context.read<BoardBloc>().add(
                   BoardEvent.deleteRow(
                     groupItem.row.id,
                     groupItem.fieldInfo.id,
                   ),
        );
}
...
<!-- gh-comment-id:1455539614 --> @AmanNegi commented on GitHub (Mar 6, 2023): Hey @LucasXu0 I am really confused how to do this, I am able to delete the document `onEditComplete` but I am not able to get the text and check if it's null/empty. Could you please guide me in this? To Delete the Item, I am doing the following: ``` dart // board_page.dart ... onEndEditing: (){ // TODO: Check if the field is empty // Deleting the Item context.read<BoardBloc>().add( BoardEvent.deleteRow( groupItem.row.id, groupItem.fieldInfo.id, ), ); } ... ```
Author
Owner

@LucasXu0 commented on GitHub (Mar 9, 2023):

Hey, @AmanNegi. What do you mean that adding basic input validation and trimming the input? The field can be empty. I guess you want to add a placeholder text to the empty field.

<!-- gh-comment-id:1461303514 --> @LucasXu0 commented on GitHub (Mar 9, 2023): Hey, @AmanNegi. What do you mean that `adding basic input validation and trimming the input`? The field can be empty. I guess you want to add a placeholder text to the empty field.
Author
Owner

@AmanNegi commented on GitHub (Mar 9, 2023):

Yeah, that should be ideal, however, if the user clears the placeholder text and saves null/empty text we should handle that case as well.

  • I noticed that we add the item to the db as soon as we press add. Thus it's displayed in the UI as well.
  • Then, we open it for editing, and once the user is done editing we update the text, in the item.
  • Instead before updating the text to the item, we should check if it's empty.
    • In case it is empty we should simply delete that item(or throw a prompt).
    • Otherwise, simply save the updated item.

As I mentioned above that I was able to successfully delete the item, once it is done editing. However, I am unable to get the object/reference to check if the updated text is empty. I need help with getting the reference to the field and the text stored in it currently, to make the check and delete or save appropriately.

<!-- gh-comment-id:1461316195 --> @AmanNegi commented on GitHub (Mar 9, 2023): Yeah, that should be ideal, however, if the user clears the placeholder text and saves `null/empty` text we should handle that case as well. - I noticed that we add the item to the `db` as soon as we press `add`. Thus it's displayed in the UI as well. - Then, we open it for editing, and once the user is done editing we update the text, in the item. - Instead before updating the text to the item, we should check if it's empty. - In case it is empty we should simply delete that item(or throw a prompt). - Otherwise, simply save the updated item. As I mentioned [above](https://github.com/AppFlowy-IO/AppFlowy/issues/1898#issuecomment-1455539614) that I was able to successfully delete the item, once it is done editing. However, I am unable to get the object/reference to check if the updated text is empty. I need help with getting the reference to the field and the text stored in it currently, to make the check and delete or save appropriately.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#747
No description provided.