Skip to content

Fix nodes appearing in wrong position #213

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

Merged
merged 4 commits into from
Aug 29, 2023
Merged

Conversation

grokys
Copy link
Member

@grokys grokys commented Aug 28, 2023

Previously, a cell with focus wasn't being recycled when the parent row was removed as TreeDataGridPresenterBase.RecycleElement was being called on it, which has logic to keep the focused element around. This makes no sense when the containing row has been removed, instead RecycleElementOnItemRemoved should be called.

Add TreeDataGridPresenterBase.UnrealizeOnRowRemoved (with an override in TreeDataGridRowsPresenter) and make TreeDataGridPresenterBase.RecycleElementOnItemRemoved call it.

Fixes #210

grokys added 4 commits August 28, 2023 10:48
Doesn't catch the issue I'm looking for but might be useful?
Previously, a cell with focus wasn't being recycled when the parent row was removed as `TreeDataGridPresenterBase.RecycleElement` was being called on it, which has logic to keep the focused element around. This makes no sense when the containing row has been removed, instead `RecycleElementOnItemRemoved` should be called.

Add `TreeDataGridPresenterBase.UnrealizeOnRowRemoved` (with an override in  `TreeDataGridRowsPresenter`) and make `TreeDataGridPresenterBase.RecycleElementOnItemRemoved` call it.
As it will be cleared when the element is realized.
Copy link
Collaborator

@danipen danipen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@danipen danipen merged commit 4ec3e20 into master Aug 29, 2023
@danipen danipen deleted the fixes/210-nodes-wrong-position branch August 29, 2023 10:03
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

Successfully merging this pull request may close these issues.

Nodes in wrong position appear after collapsing nodes
2 participants