Skip to content

Commit 6f1190d

Browse files
Copilotanupriya13
andcommitted
Add tooltipProperties with MaxWidth to prevent tooltip truncation
Co-authored-by: anupriya13 <[email protected]>
1 parent d7d7269 commit 6f1190d

File tree

9 files changed

+11
-3
lines changed

9 files changed

+11
-3
lines changed

NewArch/src/components/Badge.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export function Badge(props: {
3131
return (
3232
<View
3333
style={[styles.badgeContainer, {backgroundColor: props.badgeColor}]}
34-
tooltip={props.description}>
34+
tooltip={props.description}
35+
tooltipProperties={{MaxWidth: 500}}>
3536
<Text style={[styles.badgeText, {color: props.textColor}]}>
3637
{props.badgeTitle}
3738
</Text>

NewArch/src/components/Controls.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function Hyperlink({url, text}: HyperlinkProps): JSX.Element {
2828
return (
2929
<Pressable
3030
tooltip={url}
31+
tooltipProperties={{MaxWidth: 500}}
3132
accessibilityRole="link"
3233
accessibilityLabel={displayText}
3334
onPress={() => Linking.openURL(url)}

NewArch/src/components/CopyToClipboard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const CopyToClipboardButton = React.forwardRef<any, CopyToClipboardButtonProps>(
4545
accessibilityRole="button"
4646
accessibilityLabel={helpText}
4747
tooltip={helpText}
48+
tooltipProperties={{MaxWidth: 500}}
4849
style={styles.background}
4950
onPress={() => {
5051
Clipboard.setString(content);

NewArch/src/components/PageScroller.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const PagingButton = ({left, onPress}: PagingButtonProps) => {
2323
accessibilityRole="button"
2424
accessibilityLabel={tooltip}
2525
tooltip={tooltip}
26+
tooltipProperties={{MaxWidth: 500}}
2627
onPress={() => onPress()}
2728
onHoverIn={() => setHover(true)}
2829
onHoverOut={() => setHover(false)}

NewArch/src/components/ScreenWrapper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export function ScreenWrapper({
8282
accessibilityRole="button"
8383
accessibilityLabel="Navigation menu"
8484
tooltip={'Expand navigation menu'}
85+
tooltipProperties={{MaxWidth: 500}}
8586
// requires react-native-gesture-handler to be imported in order to pass testing.
8687
// blocked by #125
8788
//accessibilityState={{expanded: useIsDrawerOpen()}}

src/components/Badge.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export function Badge(props: {
3131
return (
3232
<View
3333
style={[styles.badgeContainer, {backgroundColor: props.badgeColor}]}
34-
tooltip={props.description}>
34+
tooltip={props.description}
35+
tooltipProperties={{MaxWidth: 500}}>
3536
<Text style={[styles.badgeText, {color: props.textColor}]}>
3637
{props.badgeTitle}
3738
</Text>

src/components/CopyToClipboard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const CopyToClipboardButton = ({content}: CopyToClipboardButtonProps) => {
4444
accessibilityRole="button"
4545
accessibilityLabel={helpText}
4646
tooltip={helpText}
47+
tooltipProperties={{MaxWidth: 500}}
4748
style={styles.background}
4849
onPress={() => {
4950
Clipboard.setString(content);

src/components/PageScroller.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const PagingButton = ({left, onPress}: PagingButtonProps) => {
2424
accessibilityRole="button"
2525
accessibilityLabel={tooltip}
2626
tooltip={tooltip}
27+
tooltipProperties={{MaxWidth: 500}}
2728
onPress={() => onPress()}
2829
onHoverIn={() => setHover(true)}
2930
onHoverOut={() => setHover(false)}>

src/components/ScreenWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function ScreenWrapper({
8080
<TouchableHighlight
8181
accessibilityRole="button"
8282
accessibilityLabel="Navigation bar hamburger icon"
83-
{...{tooltip: 'Expand Menu'}}
83+
{...{tooltip: 'Expand Menu', tooltipProperties: {MaxWidth: 500}}}
8484
// requires react-native-gesture-handler to be imported in order to pass testing.
8585
// blocked by #125
8686
//accessibilityState={{expanded: useIsDrawerOpen()}}

0 commit comments

Comments
 (0)