Skip to content

ComboBox - fix disappearing items - #1079

Closed
davidjohnoliver wants to merge 4 commits into
masterfrom
dev/djo/combobox-kidnap-fix
Closed

davidjohnoliver wants to merge 4 commits into
masterfrom
dev/djo/combobox-kidnap-fix

Conversation

@davidjohnoliver

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): fixes #1078

Improves handling of the case where items (in Items or ItemsSource) are views. This case is tricky because the SelectedItem needs to be displayed in the dropdown list when the dropdown is open, and inside the ComboBox's template when it's not.

PR Type

What kind of change does this PR introduce?

Bugfix

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

If SelectedItem is a view, ensure it's correctly placed in either the ContentPresenter or the dropdown list according to whether the dropdown is open.

This fixes bug where the item would disappear from the ContentPresenter if the dropdown were light-dismissed without changing the selection, and makes the logic more robust in the case of a virtualized list.
Certain Styles application sequences can lead to the same ItemsPanelTemplate (but not reference-equal) being applied multiple times.

As a perf improvement, don't reapply the panel. This also works around the issue on Android that changing the ItemsPanel of a ListView after it's already been materialized isn't properly supported and causes errors.
@ghuntley ghuntley added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform kind/bug Something isn't working labels Jun 19, 2019

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this something that can be tested ?

@davidjohnoliver

Copy link
Copy Markdown
Contributor Author

Is this something that can be tested ?

Yep. :) Note that I've included these changes in #1134, I'll add the tests there.

@mergify
mergify Bot deleted the dev/djo/combobox-kidnap-fix branch July 4, 2019 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComboBox support for view items is glitchy

4 participants