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

TreeView: Set IsExpanded when last child has been removed #2449

Merged

Conversation

marcelwgn
Copy link
Collaborator

Description

Add code that set's the IsExpanded of a node to false when it's last child has been removed.

Motivation and Context

Fixes #2332

How Has This Been Tested?

Add new API test

Screenshots (if appropriate):

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label May 15, 2020
@ranjeshj ranjeshj requested a review from kaiguo May 15, 2020 20:09
@ranjeshj ranjeshj added area-TreeView team-Controls Issue for the Controls team needs-cherrypicktorelease PR tagged for cherry-pick to the current release branch (but not yet picked) and removed needs-triage Issue needs to be triaged by the area owners labels May 15, 2020
@kaiguo
Copy link
Contributor

kaiguo commented May 18, 2020

/azp run

Copy link
Contributor

@kaiguo kaiguo left a comment

Choose a reason for hiding this comment

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

:shipit:

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Felix-Dev
Copy link
Contributor

My WinUI build system is currently broken so I can't check myself. What happens when the items source for a treeview item is changed and the item was previously expanded? Does the IsExpanded state change to collapsed in this situation?

@marcelwgn
Copy link
Collaborator Author

In what scenario exactly? If you remove and readd the collection, I don't think we could restore the IsExpanded state anyway. But If you look at the tests, in cases where the list changes, I think in most cases the IsExpanded state won't change.

@Felix-Dev
Copy link
Contributor

Managed to build WinUI and the test app again, seems fine to me.

@StephenLPeters
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@StephenLPeters StephenLPeters left a comment

Choose a reason for hiding this comment

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

:shipit:

@StephenLPeters
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters StephenLPeters merged commit 2aa9a15 into microsoft:master May 20, 2020
ranjeshj pushed a commit that referenced this pull request Jul 7, 2020
* Add test for IsExpanded not being set to false when removing last child

* Fix issue with setting IsExpanded not to false when removing last child

* Fix test failures

* Fix test
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.4.3 has been released which incorporates this pull request.:tada:

Handy links:

@ranjeshj ranjeshj removed the needs-cherrypicktorelease PR tagged for cherry-pick to the current release branch (but not yet picked) label Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TreeView team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TreeView does not set the IsExpanded property to false when removing the last child node
6 participants