Skip to content

ComboBox virtualization, item kidnapping fixes - #1134

Merged
davidjohnoliver merged 23 commits into
masterfrom
dev/djo/combobox-virt-2
Jul 16, 2019
Merged

davidjohnoliver merged 23 commits into
masterfrom
dev/djo/combobox-virt-2

Conversation

@davidjohnoliver

@davidjohnoliver davidjohnoliver commented Jun 25, 2019 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): Fixes #555, partially addresses #556 and #1133, fixes #1078

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature

What is the current behavior?

What is the new behavior?

  • [WASM] ComboBox is now virtualized
  • [WASM] ListView supports non-Stretch alignments properly.
  • [All] Fixes issues with views in Items/ItemsSource being 'kidnapped' when closing and opening ComboBox dropdown.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@carldebilly

Copy link
Copy Markdown
Member

19 commits for that ? ;-)

using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236

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.

Usually I like to clean that up...

@davidjohnoliver

Copy link
Copy Markdown
Contributor Author

19 commits for that ? ;-)

You've already reviewed most of them. ;) It includes #1061 which had to be reverted, and also #1079

@ghuntley

ghuntley commented Jul 2, 2019

Copy link
Copy Markdown
Member

/azp run

@davidjohnoliver davidjohnoliver mentioned this pull request Jul 4, 2019
3 of 7 tasks
@davidjohnoliver

Copy link
Copy Markdown
Contributor Author

TODO: Add UI tests for 'kidnapping'

@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 Jul 4, 2019
@carldebilly

Copy link
Copy Markdown
Member

Error CS1061: 'FrameworkElement' does not contain a definition for 'GetVisualTreeParent'

 - Inherit CarouselPanel from VirtualizingPanel, use ItemsStackPanelLayout
 - amend ComboBox style to support virtualization
Make the case more robust where the list initially measures with a smaller desired size than what is available, ie the items don't fill all available space.

This fixes a bug with the former logic where, after returning a smaller desired size than what was available, the list would be remeasured with that returned size, and then 'forget' that more space had been available.
Fix layout attributes not updating with dynamic sizes correctly, it seems that in some cases PreferredLayoutAttributesFittingAttributes() may be called out of order.
This can occur when Measure() is called outside of the usual loop, followed by ScrollIntoView().
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.
This is a significant perf optimization since UpdateLayout() is called very frequently while scrolling.
When ListView has non-Stretched breadth, item elements must be arranged with the list's breadth rather than their desired size. (Otherwise, eg, selected state highlight doesn't stretch to full width.)
Revert virtualization on these platforms because it breaks layouting (ComboBox dropdown stretches to full width of window). It can be reenabled when #1133 is fixed.
@davidjohnoliver
davidjohnoliver force-pushed the dev/djo/combobox-virt-2 branch from 3011c19 to fe04884 Compare July 15, 2019 19:32
@davidjohnoliver
davidjohnoliver force-pushed the dev/djo/combobox-virt-2 branch from 9ef06fa to 8fe277d Compare July 16, 2019 01:08
@davidjohnoliver
davidjohnoliver force-pushed the dev/djo/combobox-virt-2 branch from 8fe277d to 69658bd Compare July 16, 2019 01:56
@davidjohnoliver
davidjohnoliver merged commit 7f003e1 into master Jul 16, 2019
@delete-merged-branch
delete-merged-branch Bot deleted the dev/djo/combobox-virt-2 branch July 16, 2019 14:43
kazo0 added a commit to kazo0/uno that referenced this pull request Mar 6, 2026
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 wasm: ComboBox is unreasonably slow

3 participants