Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix chat-link in end of line displays tooltip over text and not on link #29134

Merged
merged 8 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
revert comment and use function destructure
  • Loading branch information
teneeto committed Oct 11, 2023
commit d6f8379d107409f3a25c5d02a4d23f3a83e58637
4 changes: 4 additions & 0 deletions src/components/Hoverable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Hoverable extends Component {
if (!scrolling && this.isHoveredRef) {
this.setState({isHovered: this.isHoveredRef}, this.props.onHoverIn);
} else if (scrolling && this.isHoveredRef) {
/**
* If the user has started scrolling and the isHoveredRef is true, then we should set the hover state to false.
* This is to hide the existing hover and reaction bar.
*/
this.setState({isHovered: false}, this.props.onHoverOut);
}
this.isScrollingRef = scrolling;
Expand Down
9 changes: 4 additions & 5 deletions src/components/Tooltip/BaseTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import _ from 'underscore';
import React, {memo, useCallback, useEffect, useRef, useState} from 'react';
import {Animated} from 'react-native';
import {BoundsObserver} from '@react-ng/bounds-observer';
import Str from 'expensify-common/lib/str';
import TooltipRenderedOnPageBody from './TooltipRenderedOnPageBody';
import Hoverable from '../Hoverable';
import * as tooltipPropTypes from './tooltipPropTypes';
Expand Down Expand Up @@ -53,9 +54,7 @@ function chooseBoundingBox(target, clientX, clientY) {
return bbs[0];
}

function Tooltip(props) {
const {children, numberOfLines, maxWidth, text, renderTooltipContent, renderTooltipContentKey, shouldHandleScroll} = props;

function Tooltip({children, numberOfLines, maxWidth, text, renderTooltipContent, renderTooltipContentKey, shouldHandleScroll, shiftHorizontal, shiftVertical}) {
const {preferredLocale} = useLocalize();
const {windowWidth} = useWindowDimensions();

Expand Down Expand Up @@ -183,8 +182,8 @@ function Tooltip(props) {
yOffset={yOffset}
targetWidth={wrapperWidth}
targetHeight={wrapperHeight}
shiftHorizontal={_.result(props, 'shiftHorizontal')}
shiftVertical={_.result(props, 'shiftVertical')}
shiftHorizontal={Str.result(shiftHorizontal)}
shiftVertical={Str.result(shiftVertical)}
text={text}
maxWidth={maxWidth}
numberOfLines={numberOfLines}
Expand Down
Loading