Fix tooltip truncation for buttons and badges in New Architecture#736
Draft
Fix tooltip truncation for buttons and badges in New Architecture#736
Conversation
Co-authored-by: anupriya13 <[email protected]>
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
Co-authored-by: anupriya13 <[email protected]>
Contributor
Author
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)
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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 theMaxWidthproperty 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 buttonNewArch/src/components/Badge.tsx- Core Component and other badgesNewArch/src/components/ScreenWrapper.tsx- Navigation menu expand buttonNewArch/src/components/PageScroller.tsx- Scroll navigation buttonsNewArch/src/components/Controls.tsx- Documentation hyperlinksEach change adds a single line to set the tooltip properties, following the existing code patterns.
Testing
Impact
This fix improves the New Architecture version:
Fixes #704
Original prompt
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