Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] item duplicated #54

Open
bughoho opened this issue Aug 28, 2024 · 1 comment
Open

[bug] item duplicated #54

bughoho opened this issue Aug 28, 2024 · 1 comment

Comments

@bughoho
Copy link

bughoho commented Aug 28, 2024

2024-08-29.03.11.38.mov

I placed the TreeView on the second page of the PageView, the first time it entered normal, the second time there were duplicate items, or the expansion status was inconsistent.

@jawwad-hassan89
Copy link
Collaborator

Hi @bughoho, it seems that the TreeView is getting rebuilt when you change the page, which is causing the inconsistent behaviour. Try these steps to solve this issue:

  • Move the Tree state to the parent widget, so that the Tree instance does not change on page switching
  • Assign a PageStorageKey(refer to this medium article) to maintain the state of the PageView.
  • Assign a key to the TreeView to maintain its state, avoid rebuilds.

Let me know if this solves your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants