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

Fixed droplet tooltips so they no longer cover blocks #33920

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/src/blockTooltips/DropletBlockTooltipManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ DropletBlockTooltipManager.prototype.installTooltipsForCurrentCategoryBlocks_ =
const hoverDivRect = blockHoverDiv.getBoundingClientRect();
const toolboxRight = $('.droplet-palette-scroller').width();
const offsetX = Math.min(hoverDivRect.width, toolboxRight);
if (offsetX === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible offsetX could ever be 0 at a time when we would want to render the tooltip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't been able to find a case like that so far. Curious if you have any suggestions?

// This happens when we start in design mode and the toolbox hasn't yet
// rendered. In this case, skip installing the tooltips. We can try
// again when the student switches to code mode and this method is
// called again.
return;
}

// Vertically center the tooltip on the block it belongs to.
//
Expand Down