Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

Copy name/SVG buttons were hidden when hovering over icons in search results, though they worked correctly in the main view.

Root Cause

The search filter used getElementsByTagName('div') which selected all divs inside #icons, including child .copy-buttons containers. These child divs lack data-name attributes, so they were set to display: none during filtering.

Changes

  • Changed selector from getElementsByTagName('div') to getElementsByClassName('icon') to only filter icon containers, not their children
  • Added let declaration to loop variable for consistency
- let icon = wrapper.getElementsByTagName('div');
+ let icon = wrapper.getElementsByClassName('icon');

- for (i = 0; i < icon.length; i++) {
+ for (let i = 0; i < icon.length; i++) {

Before/After

Before After
before after

💡 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.

Changed getElementsByTagName('div') to getElementsByClassName('icon') to prevent
the search filter from hiding child elements like .copy-buttons.

Also added 'let' declaration to the loop variable 'i' for consistency.

Co-authored-by: hawkticehurst <39639992+hawkticehurst@users.noreply.github.com>
Copilot AI changed the title [WIP] Add copy buttons to icon search results Fix copy buttons not appearing in search results Jan 23, 2026
Copilot AI requested a review from hawkticehurst January 23, 2026 21:28
@hawkticehurst hawkticehurst marked this pull request as ready for review January 26, 2026 16:02
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 26, 2026
@hawkticehurst hawkticehurst merged commit 24ffc2d into main Jan 26, 2026
6 checks passed
@hawkticehurst hawkticehurst deleted the copilot/add-copy-buttons-to-search-results branch January 26, 2026 16:44
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.

4 participants