Skip to content

Conversation

@AmadeusW
Copy link
Contributor

@AmadeusW AmadeusW commented Nov 25, 2025

We have an accessibility bug (azdo 2615738) for the Smart Rename UI, where the focus indicator is hard to see when user set keyboard focus on an item using Tab, instead of the typical Up/Down that works correctly.

Before: (note focus is on the "DashboardController" item)
{46BE7B19-1F0C-49C8-95B5-CE83679F1FDB}

After:
image

@AmadeusW AmadeusW requested a review from a team as a code owner November 25, 2025 18:07
@dotnet-policy-service dotnet-policy-service bot added Community The pull request was submitted by a contributor who is not a Microsoft employee. Needs UX Triage labels Nov 25, 2025
@CyrusNajmabadi
Copy link
Member

After def looks good. I have no idea how the UI framework works though. @JoeRobich can you ptal?

// update the ComboBox selection to match the focused item
if (e.NewFocus is ComboBoxItem comboBoxItem && comboBoxItem.DataContext != null)
{
SelectedItem = comboBoxItem.DataContext;
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed?

Copy link
Member

Choose a reason for hiding this comment

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

Seems like we wouldn't want to select the item until the user hits enter or space.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Joey, "Seems like we wouldn't want to select the item until the user hits enter or space." is not consistent with current behavior.

Without this event handler, the highlighted item does not get previewed. Then, upon pressing Enter, it's not going to be committed (because it's not inserted into the TextBox)
{400AC562-8580-41E3-9788-821ECA0BFF14}

That's not how we currently handle up/down, where the item is selected, inserted into the TextBox, and ultimately used for rename on Enter.
{6C5EB5EE-6B5F-44FC-8C8B-A4618831BC10}

The above code makes the TAB selection behave the same way as Up/Down selection ^

Copy link
Member

Choose a reason for hiding this comment

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

Ah, sounds good. Thanks @AmadeusW!

// update the ComboBox selection to match the focused item
if (e.NewFocus is ComboBoxItem comboBoxItem && comboBoxItem.DataContext != null)
{
SelectedItem = comboBoxItem.DataContext;
Copy link
Member

Choose a reason for hiding this comment

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

Seems like we wouldn't want to select the item until the user hits enter or space.

@akhera99 akhera99 merged commit 2230d79 into dotnet:main Nov 25, 2025
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. Needs UX Triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants