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

[$500] FAB - No tooltip is displayed when hovering over FAB button when FAB menu is open #35964

Closed
2 of 6 tasks
lanitochka17 opened this issue Feb 6, 2024 · 14 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 6, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4-37.3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Click FAB button
  3. Hover over FAB button

Expected Result:

Tooltip will be displayed for FAB button when FAB menu is open (old UI behavior)

Actual Result:

Tooltip is not displayed for FAB button when FAB menu is open (old UI behavior)

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6369802_1707251082334.New_UI.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016d5a427366019641
  • Upwork Job ID: 1754982105754923008
  • Last Price Increase: 2024-02-06
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 6, 2024
@melvin-bot melvin-bot bot changed the title FAB - No tooltip is displayed when hovering over FAB button when FAB menu is open [$500] FAB - No tooltip is displayed when hovering over FAB button when FAB menu is open Feb 6, 2024
Copy link

melvin-bot bot commented Feb 6, 2024

Job added to Upwork: https://www.upwork.com/jobs/~016d5a427366019641

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 6, 2024
Copy link

melvin-bot bot commented Feb 6, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (External)

Copy link

melvin-bot bot commented Feb 6, 2024

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave8
CC @zanyrenney

@allgandalf
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

No tooltip is displayed when hovering over FAB button when FAB menu is open

What is the root cause of that problem?

We don't wrap the component in a tooltip component

What changes do you think we should make in order to solve the problem?

Wrap the component in a tooltip

<Tooltip>
...
</Tooltip>

What alternative solutions did you explore? (Optional)

N/A

@muas19
Copy link

muas19 commented Feb 6, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

No tooltip is displayed when hovering over FAB button when FAB menu is open

What is the root cause of that problem?

We don't wrap component with a tooltip

What changes do you think we should make in order to solve the problem?

Wrap it in a tooltip

What alternative solutions did you explore? (Optional)

@Tony-MK
Copy link
Contributor

Tony-MK commented Feb 6, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

What is the root cause of that problem?

In the Overlay component, we do not warp the PressableWithoutFeedback components (close buttons) with the Tooltip component.

On the other hand, the FloatingActionButton (open button) operates because it is wrapped in a Tooltip component.

<Tooltip text={translate('common.new')}>
<PressableWithoutFeedback

What changes do you think we should make in order to solve the problem?

Similar to the FloatingActionButton, we should wrap the PressableWithoutFeedback components inside the Overlay component with the Tooltip component.

<Tooltip text={translate('common.close')}>
...
</Tooltip>

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Feb 6, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

FAB - No tooltip is displayed when hovering over FAB button when FAB menu is open

What is the root cause of that problem?

The main problem with issue is that we use PopoverAnchorTooltip for FloatingActionButton which related to state of Popover

function PopoverAnchorTooltip({shouldRender = true, children, ...props}: TooltipExtendedProps) {
const {isOpen, popover} = useContext(PopoverContext);
const tooltipRef = useRef<BoundsObserver>(null);
const isPopoverRelatedToTooltipOpen = useMemo(() => {
// eslint-disable-next-line @typescript-eslint/dot-notation
const tooltipNode = tooltipRef.current?.['_childNode'] ?? null;
if (isOpen && popover?.anchorRef?.current && tooltipNode && (tooltipNode.contains(popover.anchorRef.current) || tooltipNode === popover.anchorRef.current)) {
return true;
}
return false;
}, [isOpen, popover]);
if (!shouldRender || isPopoverRelatedToTooltipOpen) {
return children;
}
return (
<BaseTooltip
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={tooltipRef}
>
{children}
</BaseTooltip>
);
}

As a result when we have open Popover, we disable Tooltip

What changes do you think we should make in order to solve the problem?

To fix this issue we can update import and use Normal Tooltip

import Tooltip from './Tooltip';

import Tooltip from './Tooltip/PopoverAnchorTooltip';

Optional we can update text depending on isActive prop

<Tooltip text={isActive ? translate('common.close') : translate('common.new')}>

<Tooltip text={translate('common.new')}>

What alternative solutions did you explore? (Optional)

NA

@DylanDylann
Copy link
Contributor

@Expensify/design Could you guys help to confirm whether this is a bug or expected?

Current behavior

Screen.Recording.2024-02-07.at.11.17.30.mov

After fixing

Screen.Recording.2024-02-07.at.11.17.20.mov

@dubielzyk-expensify
Copy link
Contributor

I'm not convinced this is a bug. By having the tooltip display "Close" so quickly it feels like it's giving itself too much prominence. Keen to hear what @Expensify/design thinks

@situchan
Copy link
Contributor

situchan commented Feb 7, 2024

Expected Result and Actual Result are reversed.
In #24296, we intentionally disabled tooltip when related popover is open.

Should we update TestRail?

@DylanDylann
Copy link
Contributor

@situchan Thanks for your information. Let's close this issue

cc @abekkala

@shawnborton
Copy link
Contributor

Down to close as well!

@dannymcclain
Copy link
Contributor

Agree that we should close this.

@abekkala abekkala closed this as completed Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests