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

Search all SelectingItemsControl items with TextSearch on key input, not just realized ones #17506

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

jonko0493
Copy link

@jonko0493 jonko0493 commented Nov 14, 2024

What does the pull request do?

This PR brings the behavior of SelectingItemControls with VirtualizingPanel presenters into parity with those controls without virtualizing presenters.

What is the current behavior?

Currently, SelectingItemsControls with VirtualizingPanel item presenters (such as ComboBox) do not search the full contents of their boxes with text search, only the currently realized controls. This means that if a ComboBox is closed, typing does nothing, and even when opened, (this was slightly wrong!) it will only jump to items immediately in the popup.

What is the updated/expected behavior with this PR?

Now, ComboBoxes and other SelectingItemsControls with virtualizing presenters will have proper TextSearch for their entire item sets.

How was the solution implemented (if it's not obvious)?

The anonymous method that existed in the SelectingItemsControl class previously has been moved into a static method in ItemsPresenter. It's now used there and in VirtualizingPanel to check search their items/children for text search. (Note: I don't know if there is a preferred place for a static method like this; happy to move as appropriate.)

Unit test case was added to an existing test and the test was adapted so that ComboBoxes in tests will use a VirtualizingStackPanel like the real controls do to ensure the tests fail without this change.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #12490.

@jonko0493 jonko0493 changed the title [SelectingItemsControl] Search all items with TextSearch on key input, not just realized ones Search all SelectingItemsControl items with TextSearch on key input, not just realized ones Nov 14, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053300-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Nov 14, 2024

  • All contributors have signed the CLA.

@jonko0493
Copy link
Author

@cla-avalonia agree

@jonko0493
Copy link
Author

Everything was passing prior to me merging master... not sure what changed, could be transient failures?

@timunie
Copy link
Contributor

timunie commented Nov 17, 2024

@jonko0493 don't worry tests are a bit flaky atm

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053407-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053771-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053885-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053987-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

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.

[SelectingItemsControl] TextSearch in all items, not only realized items
4 participants