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

Don't always focus pane content on Tapped, if the pane is already focused #17174

Merged
merged 5 commits into from
May 2, 2024

Conversation

zadjii-msft
Copy link
Member

You'll never believe this. Clicking on the dropdown button on a ComboBox doesn't set e.Tapped = true. It bubbles up, and lands in our Pane's Border's tapped handler. And in there, we yeet focus to the first content. We end up stealing focus from the combobox, and then the combobox doesn't actually open its dropdown.

So yea we can just fix that. Easy enough.

Closes #17062

@zadjii-msft zadjii-msft changed the title i'm just gonna start by committing everything Don't always focus pane content on Tapped, if the pane is already focused May 1, 2024
@@ -31,7 +31,8 @@
<local:SettingContainer x:Uid="Globals_Language"
Visibility="{x:Bind ViewModel.LanguageSelectorAvailable}">
<ComboBox ItemsSource="{x:Bind ViewModel.LanguageList}"
SelectedItem="{x:Bind ViewModel.CurrentLanguage, Mode=TwoWay}">
SelectedItem="{x:Bind ViewModel.CurrentLanguage, Mode=TwoWay}"
Style="{StaticResource ComboBoxSettingStyle}">
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a drive-by that I discovered while investigating.

@@ -11,7 +11,7 @@ Licensed under the MIT license.
#include <conattrs.hpp>
#include "MySettings.g.h"

using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, uint32_t>;
using IFontFeatureMap = winrt::Windows::Foundation::Collections::IMap<winrt::hstring, float>;
Copy link
Member Author

Choose a reason for hiding this comment

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

Another drive-by to fix the scratch app build

src/cascadia/TerminalApp/Pane.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Pane.cpp Outdated Show resolved Hide resolved
// Don't focus our content if we're already focused. This prevents a bug
// where tapping on the arrow in a ComboBox will land in our Tapped handler,
// and if we steal focus from the ComboBox, it won't open. See GH#17062
if (WasLastFocused())
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way for us to check if focus is currently inside our pane? Rather than us trying to remember it.

Co-authored-by: Leonard Hecker <lhecker@microsoft.com>
@zadjii-msft zadjii-msft enabled auto-merge May 2, 2024 10:58
@zadjii-msft zadjii-msft added this pull request to the merge queue May 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 2, 2024
@zadjii-msft zadjii-msft added this pull request to the merge queue May 2, 2024
@DHowett DHowett removed this pull request from the merge queue due to a manual request May 2, 2024
@DHowett DHowett merged commit c2b8f99 into main May 2, 2024
20 checks passed
@DHowett DHowett deleted the dev/migrie/b/17062-comboboxes-are-scary branch May 2, 2024 16:12
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.

[1.21] Clicking on the right side of a combobox doesn't cause it to open / dropdown
4 participants