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

fix: quick pick filter removes selection #5613

Merged
merged 1 commit into from Jan 21, 2024
Merged

fix: quick pick filter removes selection #5613

merged 1 commit into from Jan 21, 2024

Conversation

deboer-tim
Copy link
Collaborator

What does this PR do?

As you filter the quick pick would automatically select the first item that's left, but would never deselect, so (e.g.) if you type 'ddd' you're selecting whatever the last item that started with 'd' was (or the first item ever shown if there were none that started with d). This just adds the deselection if there are no items that match the filter.

I decided to use the 'onSelectCallback' to test and found a second problem: the callback is not called when the selection is changed due to filtering. That is fixed and tested as well.

Screenshot / video of UI

N/A

What issues does this PR fix or reference?

Fixes #5610.

How to test this PR?

See issue for original problem; confirm tests catch this case.

As you filter the quick pick would automatically select the first item
that's left, but would never deselect, so (e.g.) if you type 'ddd' you're
selecting whatever the last item that started with 'd' was (or the first
item ever shown if there were none that started with d). This just adds the
deselection if there are no items that match the filter.

I decided to use the 'onSelectCallback' to test and found a second problem:
the callback is not called when the selection is changed due to filtering.
That is fixed and tested as well.

Fixes #5610.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@deboer-tim deboer-tim requested review from benoitf and a team as code owners January 21, 2024 03:28
@deboer-tim deboer-tim requested review from dgolovin and cdrage and removed request for a team January 21, 2024 03:28
@deboer-tim deboer-tim merged commit 4cc7c04 into main Jan 21, 2024
8 checks passed
@deboer-tim deboer-tim deleted the quick-pick-2 branch January 21, 2024 14:52
@podman-desktop-bot podman-desktop-bot added this to the 1.7.0 milestone Jan 21, 2024
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.

Quick pick selects unexpected option
3 participants