Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 14, 2025

Problem

Tooltips were being truncated when hovering over various UI elements throughout the React Native Gallery application, affecting user experience and accessibility. The truncation occurred on:

  • Copy to Clipboard buttons (in example code sections and throughout the app)
  • Navigation menu Expand/Collapse button
  • Core Component badges and other informational badges
  • Page scroller left/right navigation buttons
  • Documentation hyperlinks

Users could not see the full tooltip text, which violated accessibility guidelines (MAS 1.4.13 – Content on Hover or Focus) and created confusion about button purposes.

Root Cause

React Native Windows tooltips use the XAML ToolTip control, which has a default maximum width constraint. When tooltip text exceeded this default width, it would truncate in the middle of words or even characters, rather than wrapping to multiple lines.

Solution

Added tooltipProperties={{MaxWidth: 500}} to all components using tooltips in the New Architecture version only. This Windows-specific prop passes the MaxWidth property to the underlying XAML ToolTip control, allowing tooltips to expand up to 500 pixels wide before wrapping text. This prevents truncation while maintaining reasonable tooltip dimensions.

Changes

Modified 5 component files in the New Architecture version:

New Architecture:

  • NewArch/src/components/CopyToClipboard.tsx - Copy to clipboard button
  • NewArch/src/components/Badge.tsx - Core Component and other badges
  • NewArch/src/components/ScreenWrapper.tsx - Navigation menu expand button
  • NewArch/src/components/PageScroller.tsx - Scroll navigation buttons
  • NewArch/src/components/Controls.tsx - Documentation hyperlinks

Each change adds a single line to set the tooltip properties, following the existing code patterns.

Testing

  • ✅ Changes applied only to NewArch directory as requested
  • ✅ Changes are minimal and surgical
  • ✅ Follows existing code style and patterns

Impact

This fix improves the New Architecture version:

  • Accessibility: Meets MAS 1.4.13 guidelines for content on hover/focus
  • User Experience: Users can now read complete tooltip information
  • Usability: Eliminates confusion about control purposes

Fixes #704

Original prompt

This section details on the original issue you should resolve

<issue_title>On hovering over the 'Copy to Clipboard' button tooltip is getting truncated.</issue_title>
<issue_description>Build Details:
OS Version: 24H2
OS Build: 26100.5074
App: React Native Gallery Preview

Repro-Steps:
Launch the React Native Gallery-Preview app.
Navigate to the 'Expand menu' button and invoke it.
Navigate to any of the button and invoke it.
Now mouse hover on the 'Copy to clipboard' button and observe the issue
Actual Result:
On hovering over the 'Copy to Clipboard' button tooltip is getting truncated.

Note:
Same issue is also observed for all 'Source Code' & 'and for all 'Copy to clipboard' button present throughout the application.
Invoke 'Dialogs & flyouts' button >> Invoke 'Modal' button, same issue is observed for 'Modal Source Code' link present under 'Documentation group
Same issue is observed for 'Expand/Collapse' button
Same issue is observed for all "Core Component" buttons available in entire application
Expected Result:
On hovering over the 'Copy to Clipboard' button tooltip should be visible clearly without any truncation.

User impact:
Users may not see the full tooltip, which can confuse them about the button's purpose.

MAS Reference Link: MAS 1.4.13 – Content on Hover or Focus

Trap ID:7.1 - Data Loss

“Have feedback on bugs logged, please tag bug as “A11yRCA” and add your feedback in the comment section.”</issue_description>

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

Fixes #704


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Microsoft Reviewers: Open in CodeFlow

@anupriya13
Copy link
Contributor

@copilot remove all code changes from src/components directory, cahnegs should only be in new arch directory

Copilot AI changed the title [WIP] Fix tooltip truncation on copy to clipboard button Fix tooltip truncation for buttons and badges throughout the application Oct 14, 2025
Copilot AI requested a review from anupriya13 October 14, 2025 04:53
Copilot finished work on behalf of anupriya13 October 14, 2025 04:53
Copy link
Contributor Author

Copilot AI commented Oct 14, 2025

@copilot remove all code changes from src/components directory, cahnegs should only be in new arch directory

Done. Removed all changes from src/components directory. The tooltipProperties changes now only exist in the NewArch/src/components directory as requested. (commit: will be included after commit completes)

@copilot remove all code changes from src/components directory, cahnegs should only be in new arch directory

Done. Removed all changes from src/components directory. The tooltipProperties changes now only exist in the NewArch/src/components directory as requested. (commit: 6213d05)

Copilot AI changed the title Fix tooltip truncation for buttons and badges throughout the application Fix tooltip truncation for buttons and badges in New Architecture Oct 14, 2025
Copilot finished work on behalf of anupriya13 October 14, 2025 04:58
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.

On hovering over the 'Copy to Clipboard' button tooltip is getting truncated.

2 participants