Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Fixes #140788

When a checkbox has DOM focus via Tab but the tree focus is on a different item, pressing Space toggles both items instead of only the focused one.

Changes

  • Add focus check callback: Pass isElementFocused callback to renderer to check tree.getFocus().includes(element)
  • Guard checkbox onChange: Only update element state if focused; otherwise revert checkbox visual state to match element
  • Preserve tree behavior: Tree's Space handler continues toggling focused items normally

The fix ensures checkbox keyboard interaction defers to tree focus, matching user expectation that the item with focus border (not DOM focus) wins.

Original prompt

This section details on the original issue you should resolve

<issue_title>When highlighted item is different than the focused item, the quickpick the quick pick will toggle both</issue_title>
<issue_description>Steps to Reproduce:

  1. Attempt to turn on settings sync
  2. hit tab a few times so that the active item is different than the focused item like so:
    image
  3. Hit space

Notice it toggles both:
image

</issue_description>

Comments on the Issue (you are @copilot in this section)

@TylerLeonhardt @meganrogge @isidorn which one do you think should win? @meganrogge I think the one with the focus border should win IE the focused one. This is consistent with how the list view works I believe @TylerLeonhardt @meganrogge int the screenshot, that would be User Snippets, yes? @isidorn Yeah I agree, the focused one should win. Ideally the checkboxes would not be tab stops. Like in the breakpoints view. That way we would avoid this confusion.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@dmitrivMS dmitrivMS added the ~copilot-video-please ⚠️WIP🏗️ Use in PRs. Runs Copilot CLI agent to record a video of "trying out the change" label Nov 6, 2025
@vs-code-engineering vs-code-engineering bot removed the ~copilot-video-please ⚠️WIP🏗️ Use in PRs. Runs Copilot CLI agent to record a video of "trying out the change" label Nov 6, 2025
Copilot AI changed the title [WIP] Fix quickpick toggling when items are focused Fix quickpick checkbox toggle when focused item differs from tabbed item Nov 6, 2025
Copilot finished work on behalf of dmitrivMS November 6, 2025 23:39
Copilot AI requested a review from dmitrivMS November 6, 2025 23:39
@vs-code-engineering
Copy link

🤖 Copilot has tried out this change! Members of the team can view the recording here or download the Playwright trace here (run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants