Skip to content

Conversation

@jspurlin
Copy link
Contributor

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ yarn change

Description of changes

Prior to this change there were cases where the tooltip may occlude its targetElement which could cause the tooltip to flash or potentially not appear at all. The issue becomes more prominent if one of more of the follow ins is present:

  1. The contents of the tooltip are large (and the targetElement is near the top left corner of the window, so that it will be occluded by the tooltip before updatePosition is run)
  2. The tooltipGapSpace is not a whole number of pixels, this is exacerbated the larger the user's devicePixelRatio which can lead to an overlap at the bottom of the targetElement (because the ::after element is slightly occluding the bottom of the targetElement)

To fix these issues I've made two fixes:

  1. When the callout is "hidden" it sets OFF_SCREEN_STYLE which sets the opacity, but the callout can still occlude the targetElement. I'm adding pointerEvents: none to the styling that is applied in this case so that it will not fire mouse events
  2. Update the tooltipGapSpace calculation to take into account the user's devicePixelRatio and compensate for the sub-pixel rounding

Focus areas to test

Verified that there is no functional behavior change outside of the fact that the targetElement is no longer occluded all the way up to 500% browser zoom across IE11, Edge, Chrome, FF, and Safari on Mac

@jspurlin jspurlin requested review from dzearing and khmakoto January 13, 2021 02:11
@msft-fluent-ui-bot msft-fluent-ui-bot added the needs cherry-pick Temporary label for PRs which may need to be cherry-picked to master label Jan 13, 2021
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 353b25e:

Sandbox Source
Fluent UI Button Configuration
codesandbox-react-template Configuration

@fabricteam
Copy link
Collaborator

Perf Analysis

No significant results to display.

All results

Scenario Render type 7.0 Ticks PR Ticks Iterations Status
BaseButton mount 1018 1020 5000
Breadcrumb mount 45178 45000 5000
Checkbox mount 1756 1759 5000
CheckboxBase mount 1459 1477 5000
ChoiceGroup mount 5443 5472 5000
ComboBox mount 967 1001 1000
CommandBar mount 8452 8372 1000
ContextualMenu mount 16722 17670 1000
DefaultButton mount 1275 1279 5000
DetailsRow mount 3978 4023 5000
DetailsRowFast mount 3995 3981 5000
DetailsRowNoStyles mount 3784 3817 5000
Dialog mount 1680 1649 1000
DocumentCardTitle mount 1937 1921 1000
Dropdown mount 2825 2802 5000
FocusTrapZone mount 1843 1844 5000
FocusZone mount 1934 1932 5000
IconButton mount 1991 1944 5000
Label mount 341 339 5000
Layer mount 2151 2136 5000
Link mount 485 484 5000
MenuButton mount 1651 1654 5000
MessageBar mount 2266 2196 5000
Nav mount 3645 3596 1000
OverflowSet mount 1617 1505 5000
Panel mount 1576 1601 1000
Persona mount 912 896 1000
Pivot mount 1524 1584 1000
PrimaryButton mount 1425 1412 5000
Rating mount 8547 8425 5000
SearchBox mount 1405 1457 5000
Shimmer mount 2816 2896 5000
Slider mount 1657 1608 5000
SpinButton mount 5462 5534 5000
Spinner mount 420 443 5000
SplitButton mount 3486 3501 5000
Stack mount 546 569 5000
StackWithIntrinsicChildren mount 1656 1691 5000
StackWithTextChildren mount 5231 5224 5000
SwatchColorPicker mount 11341 11271 5000
TagPicker mount 3080 3094 5000
TeachingBubble mount 54172 54579 5000
Text mount 486 481 5000
TextField mount 1548 1519 5000
Toggle mount 902 897 5000
button mount 124 115 5000

@size-auditor
Copy link

size-auditor bot commented Jan 13, 2021

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react office-ui-fabric-react-Facepile 204.152 kB 204.199 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-Persona 111.843 kB 111.89 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-FloatingPicker 233.934 kB 233.981 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-CommandBar 195.809 kB 195.856 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-SelectedItemsList 223.282 kB 223.329 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-PersonaCoin 111.843 kB 111.89 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-Pickers 277.233 kB 277.28 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-Breadcrumb 193.468 kB 193.515 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-Tooltip 84.011 kB 84.058 kB ExceedsBaseline     47 bytes
office-ui-fabric-react office-ui-fabric-react-MessageBar 183.568 kB 183.589 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Panel 194.98 kB 195.001 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Pivot 180.368 kB 180.389 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Dialog 204.63 kB 204.651 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-HoverCard 96.845 kB 96.866 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-DatePicker 204.749 kB 204.77 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-ContextualMenu 152.641 kB 152.662 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-DocumentCard 209.353 kB 209.374 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-ComboBox 239.426 kB 239.447 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-SearchBox 181.481 kB 181.502 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Dropdown 226.696 kB 226.717 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Callout 84.209 kB 84.23 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-TeachingBubble 199.651 kB 199.672 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Grid 175.165 kB 175.186 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Keytips 102.181 kB 102.202 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-KeytipLayer 99.07 kB 99.091 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-SpinButton 187.502 kB 187.523 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Button 188.101 kB 188.122 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Nav 182.67 kB 182.691 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-Keytip 78.693 kB 78.714 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-ButtonGrid 175.165 kB 175.186 kB ExceedsBaseline     21 bytes
office-ui-fabric-react office-ui-fabric-react-SwatchColorPicker 185.551 kB 185.572 kB ExceedsBaseline     21 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: ae56e24c4fcb61d9d9def1a39d264dfa538b6c12 (build)

@jspurlin
Copy link
Contributor Author

Ping... @khmakoto and/or @dzearing ...

@msft-fluent-ui-bot
Copy link
Collaborator

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

Handy links:

@ecraig12345 ecraig12345 added Component: Tooltip Component: Callout and removed needs cherry-pick Temporary label for PRs which may need to be cherry-picked to master labels Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants