FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
120 stars 18 forks source link

Cannot remove item at index from ListView #3660

Open HidetoKoudanshi opened 1 month ago

HidetoKoudanshi commented 1 month ago

Can we access your project?

Current Behavior

I've created dynamic children rows. There's a button you click to add a new dynamic child widget row. I want the user to long-press on the widget row and have that specific widget row be removed from the list and no longer be there. I set a long-press action on the row to "Update App State" with the "Set Fields" as my "(List \<string>)" and the "Update Type" as "Remove from List". I then test the code and when I long-press on the row, it doesn't remove the widget row I'm long-pressing on. It removes whatever the most recently-created widget row is. I made a blank project and built the issue from scratch and am using this blank project as the broken project instead of my own app, so that you can see that base functionality is broken, not that my app weirdly broke something.

Expected Behavior

I expect that when I long-press on a specific widget row, it removes that exact widget row, not the most recently-created widget row.

Steps to Reproduce

  1. Create ListView.
  2. Have it create dynamic children as a unique-keyed row.
  3. Make a long-press action on the row that updates the app state to remove from list.
  4. Test run the app and create several dynamic children widget rows.
  5. Long-press on the top-most child widget row.
  6. Watch the bottom most/most recent child widget row get removed but the one I'm long-pressing on isn't removed.

Reproducible from Blank

Bug Report Code (Required)

ITFfls/l6otIsdtK0L6JY8FFv2M4NmUcTIAFkuwacy8YGIytBu0TeM6lSxdvTc+oaVNcE1WahlsD+s7muePTNsE6PTusRqI4+M5tFhb0e2i7RaaSBpeWeEBSM8djG3K5y6SN3xZBPulYdGQbw1OUIujKQnbDIuu/Zwh9f6PHaOI=

Visual documentation

Test Mode - Bug Test - Google Chrome 2024-08-21 03-26-44.zip

Environment

- FlutterFlow version: 
- Platform: Web
- Browser name and version: Chrome 127.0.6533.120 (Official Build) (64-bit)
- Operating system and version affected: Windows 10 Pro

Additional Information

If users are creating a list of info they wish to curate, they need to be able to delete any list items they no longer want to curate and they need to be able to remove only the items they want to remove, not whatever the most recent item created is.

paulperez-dev commented 1 month ago

Hi @HidetoKoudanshi! I saw in your project that you are using the option 'Remove from List' instead of 'Remove from List at index'.

Can you please change that option and test again?

image.png
HidetoKoudanshi commented 1 month ago

I have another person trying to help me so I set it as you suggested and still it only deletes the most recent item.

HidetoKoudanshi commented 1 month ago

Someone was helping me with this and this is what he discovered:

Have seen problem is with the textbox widget same issue happen to me however if I use a static widget like text and wrap it in a stack the text updates when I delete an item but the textbox doesnt

paulperez-dev commented 1 month ago

Hi @HidetoKoudanshi! Can you please reproduce the textbox issue on a blank project/page and share the bug report code?

HidetoKoudanshi commented 1 month ago

This is a blank project. It’s not my actual app I’m working on. I built this specifically as a simple test case scenario.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.