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: reactstrap tooltips causing browser tab to freeze #4922

Merged
merged 2 commits into from Jul 17, 2019

Conversation

attfarhan
Copy link
Contributor

@attfarhan attfarhan commented Jul 17, 2019

Fixes #4853.

The commit d9e6207 resulted in a bug that would cause the entire page to freeze if the tooltip popovers that appear when hovering on some buttons had too much content, which is a bug in the upgraded version of reactstrap. This PR implements a workaround mentioned in the issue, which disables the flip modifier of the tooltip.

@attfarhan
Copy link
Contributor Author

The issue is filed in reactstrap here: reactstrap/reactstrap#1482

@attfarhan
Copy link
Contributor Author

Alternatively, we can use a workaround that was mentioned in the issue. Pushed that commit up here: b65c7de

@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #4922 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4922      +/-   ##
==========================================
+ Coverage   48.09%   48.09%   +<.01%     
==========================================
  Files         732      732              
  Lines       44645    44641       -4     
  Branches     1763     1763              
==========================================
- Hits        21471    21470       -1     
+ Misses      21207    21204       -3     
  Partials     1967     1967
Impacted Files Coverage Δ
cmd/repo-updater/repoupdater/server.go 59.15% <0%> (-0.12%) ⬇️
pkg/conf/computed.go 29.92% <0%> (+0.69%) ⬆️

Copy link
Contributor

@felixfbecker felixfbecker left a comment

Choose a reason for hiding this comment

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

Do we have to depend on the fork again, as opposed to just an older version? What is the diff in the fork that we need?

Which places in the app would the workaround with forcing bottom placement affect? I only know of the toolbar buttons, which actually always looked weird to me with left tooltips:

image

@attfarhan
Copy link
Contributor Author

@felixfbecker there's quite a number of places we use tooltips that could potentially be affected: https://sourcegraph.com/search?q=r:%5Egithub.com/sourcegraph/sourcegraph%24+data-tooltip
Didn't go through all of them.

There's actually a slightly better workaround in that issue. I think that's the workaround we should implement, actually. 7f2671e

@attfarhan attfarhan changed the title Re-vendor reactstrap Fix: reactstrap tooltips causing browser tab to freeze Jul 17, 2019
@attfarhan
Copy link
Contributor Author

@felixfbecker the flip modifier tries to flip the direction of the popover if it's too close to the edge of the container. It's on by default, and seems to be what causes the tooltip to freak out as it tries to flip in an infinite loop.

Copy link
Contributor

@nicksnyder nicksnyder left a comment

Choose a reason for hiding this comment

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

@attfarhan can you update the PR description to describe the final diff.

@keegancsmith fyi as release captain this will need to get cherry-picked into the release branch

@attfarhan attfarhan merged commit 6fef4bf into master Jul 17, 2019
@attfarhan attfarhan deleted the fa/revert-partially branch July 17, 2019 21:24
attfarhan added a commit that referenced this pull request Jul 17, 2019
Disables the `flip` modifier on the tooltip component, a temporary workaround for the bug in reactstrap.
flip: {
enabled: false,
},
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

When adding a workaround like this, add a comment linking to the issue so we know to remove it when the issue is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search results page causes Sourcegraph tab to freeze in Firefox
3 participants