Skip to content

Page scrolls in list view when adding or removing item from it #490

@MohitKandu25

Description

@MohitKandu25

Issue tracker is ONLY used for reporting bugs. New feature suggestions and questions should be discussed on Community or submitted through our user feedback form.

Your issue may already be reported! Please search in the issue tracker before creating one.

Please thumbs up this issue if you have also experienced it. You may also add more information if there is something relevant that was not mentioned. However, please refrain from comments that are not constructive, like "I have this problem too", etc.

Expected behavior (required)

Tapping the "add" button should add an item to the list and retain the position on the page.

Current behavior (required)

Tapping the "add" button does add the item but the page scrolls somewhere

To Reproduce (required)

  1. create a local state with following structure:
    {
    "name":"",
    "sessionOrder":1,
    "activities":[
    "activityName":"",
    "sessionOrder":1,
    "activityOrder":1,
    "subActivitites":[
    "subActivityName":"",
    "subActivityOrder":1
    ]
    ]
    }
  2. Create a new page
  3. Add a list view (sessions)
  4. Add a text field
  5. Generate dynamic children from the local state on this list view
  6. Wrap the list view in a column and add a text "Add another session"
  7. Create a custom action "add session" and add this to the "on tap" action of the text "Add another session"
  8. Create another list view inside this (activities)
  9. Add a text field
  10. Generate dynamic children from the "$.activities" path from sessions list item on this list view
  11. Wrap the list view in a column and add a text "Add another activity"
  12. Create a custom action "add activity" and add this to the "on tap" action of the text "Add another activity"
  13. Create yet another list view inside this (subActivities)
  14. Add a text field
  15. Bind the text field on step 4 with the local state by giving it the value "$.name" from session list item
  16. Bind the text field on step 7 with local state by giving it the value "$.activityName" from the activity list item
  17. Bind the text field on step 10 with local state by giving it the value "$.subActivityName" from the subActivity list item
  18. Add a custom action for each of the text fields "sessionChangeHandler", "activityChangeHandler" and "subActivityChangeHandler" which updates the local state with its value.
  19. Attach this to the "onChange" action of the respective text fields
  20. run the app
  21. type something on session field
  22. click on the add activity button
  23. the activity does get added to the list but the page scrolls upwards to the field where you had typed earlier

Code can be included in this section if it is relevant to reproducing the bug.
-->

Context (required)

When I add items to my list, the page scrolls up which is an inconvenience especially if the there are lots of items in the list.

Screenshots / recordings

Scroll.issue.with.list.view.mp4

Your environment

Version of FlutterFlow used: v3.0 February 12, 2023 - Flutter 3.3.4
Browser name and version: Google Chrome 103.0.5060.134 (Official Build) (64-bit)
Operating system and version: Ubuntu 20.04.4 LTS

Metadata

Metadata

Labels

status: needs informationMore information/context is needed for assessment.status: needs triageA potential issue that has not been confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions