Skip to content

Tooltip: Fixing 'persist on scroll' issues#9749

Merged
micahgodbolt merged 3 commits intomicrosoft:masterfrom
khmakoto:tooltipHover
Jul 10, 2019
Merged

Tooltip: Fixing 'persist on scroll' issues#9749
micahgodbolt merged 3 commits intomicrosoft:masterfrom
khmakoto:tooltipHover

Conversation

@khmakoto
Copy link
Copy Markdown
Member

@khmakoto khmakoto commented Jul 9, 2019

Pull request checklist

Description of changes

This PR fixes some issues that existed on the Tooltip component:

  • The Tooltip was not dismissing on scroll when the focus was on the element
  • The Tooltip was not dismissing on scroll until the scroll stopped
  • You couldn't scroll the document when hovering over a Tooltip

The first two bugs was introduced in Fabric 5.77.0 as part of PR #4364.

Focus areas to test

  • Hover over a component with a Tooltip in the Tooltip examples page and notice the difference between the live website and this PR when scrolling after the Tooltip appears.
  • Move focus with your keyboard over a component with a Tooltip in the Tooltip examples page and notice the difference between the live website and this PR when scrolling after the Tooltip appears.
  • Hover over a Tooltip in the Tooltip examples page (easiest to do this is the Tooltip with delay closing). Once you are hovering the Tooltip, start scrolling and notice the difference between the live website and this PR.
Microsoft Reviewers: Open in CodeFlow

Copy link
Copy Markdown
Contributor

@Vitalius1 Vitalius1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny that this bug was present for so long and surfaced only now. Do you have the PR number that introduced the regression? Was it by mistake or intentional?

@micahgodbolt
Copy link
Copy Markdown
Member

few quick Qs.

  1. does this address tooltips with delays?
  2. Can you figure out why scroll doesn't work when you hover over the tooltip (keeping focus)

@size-auditor
Copy link
Copy Markdown

size-auditor bot commented Jul 10, 2019

Bundle test Size (minified) Diff from master
FloatingPicker 220.903 kB ExceedsBaseline     54 bytes
Tooltip 88.033 kB ExceedsBaseline     54 bytes
Breadcrumb 182.29 kB ExceedsBaseline     54 bytes
Pickers 261.201 kB ExceedsBaseline     54 bytes
SelectedItemsList 211.146 kB ExceedsBaseline     54 bytes
CommandBar 184.298 kB ExceedsBaseline     54 bytes
Facepile 193.556 kB ExceedsBaseline     54 bytes
PersonaCoin 114.359 kB ExceedsBaseline     54 bytes
Persona 114.359 kB ExceedsBaseline     54 bytes

ExceedsTolerance  Exceeds Tolerance     ExceedsBaseline  Exceeds Baseline     BelowBaseline  Below Baseline     1 kB = 1000 bytes

@khmakoto
Copy link
Copy Markdown
Member Author

@micahgodbolt:

1.- Yes, the example with tooltips with delays was still working when I tested this change.
2.- I'm kind of confused, what do you mean by this? Is this a separate bug from those filed in #9694?

@khmakoto
Copy link
Copy Markdown
Member Author

@Vitalius1 it's PR #4364, the PR adds delayed functionality to the Tooltip component but seems to have added these bugs by mistake.

@msft-github-bot
Copy link
Copy Markdown
Contributor

msft-github-bot commented Jul 10, 2019

Component Perf Analysis:

Scenario Master Samples * PR Samples *
BaseButton 877 842
BaseButton (experiments) 1790 1775
DefaultButton 1151 1139
DefaultButton (experiments) 1992 2048
DetailsRow 5685 5804
DetailsRow without styles 5781 5695
DocumentCardTitle with truncation 42288 39805
MenuButton 1910 1889
MenuButton (experiments) 4490 4488
PrimaryButton 1274 1268
PrimaryButton (experiments) 2224 2274
SplitButton 3796 3829
SplitButton (experiments) 8525 8497
Stack 491 521
Stack with Intrinsic children 1872 1961
Stack with Text children 5269 5593
Text 422 425
Toggle 987 958
Toggle (experiments) 2506 2373
button 71 67
* Sample counts can vary by up to 30% and shouldn't be used solely for determining regression. For more information please see the Perf Testing wiki.

@khmakoto
Copy link
Copy Markdown
Member Author

@micahgodbolt I think I know what you mean by your second question now. That seems to be the behavior since Tooltip uses Callout, which as another surface doesn't allow for scrolling when focus is inside. You can check this behavior in the Callout examples as well.

@micahgodbolt
Copy link
Copy Markdown
Member

micahgodbolt commented Jul 10, 2019 via email

@khmakoto
Copy link
Copy Markdown
Member Author

@micahgodbolt let me investigate.

@khmakoto khmakoto requested a review from joschect as a code owner July 10, 2019 20:57
@khmakoto
Copy link
Copy Markdown
Member Author

@micahgodbolt just pushed a commit to allow scrolling when hovering over a Tooltip.

@micahgodbolt
Copy link
Copy Markdown
Member

now what's the chance that someone has a tooltip with so much content that it has to scroll :-\

If that comes up i guess we can simply check for overflow....but people really shouldn't have that much content in a tooltip.

@khmakoto
Copy link
Copy Markdown
Member Author

@micahgodbolt yes, I feel like the Tooltip shouldn't be used like that in the first place so I think we should be ok with this change.

@micahgodbolt
Copy link
Copy Markdown
Member

jon is on vacation. going to merge this in

@micahgodbolt micahgodbolt merged commit 7b43fd5 into microsoft:master Jul 10, 2019
@khmakoto khmakoto deleted the tooltipHover branch July 10, 2019 23:32
@msft-github-bot
Copy link
Copy Markdown
Contributor

🎉office-ui-fabric-react@v7.8.2 has been released which incorporates this pull request.:tada:

Handy links:

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooltip Persists After Scrolling

4 participants