Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe
}

function showTooltip() {
// Insert the element before positioning it, so we can get the position
// Insert the element and position at top left, so we can get the position
// and check if we should display it
element.css({top: 0, left: 0});
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Why is this necessary to check computed style 'display' ?
  • Would you not want to init the position off-screen?
  • eg element.css({top:-100, left:0})

Copy link
Author

Choose a reason for hiding this comment

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

It fixes a bug where the tooltip being displayed at its default location causes the scrollbar to appear and then the positioning of the tooltip is off when the tooltip moves and the scrollbar disappears. The bug: #4345

element.css({top:-100, left:0}) also works. I don't have a preference since either way works just as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

As @lelanophilus noted, this prevents toolbars.

Copy link
Author

Choose a reason for hiding this comment

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

What is the action item right now? I'd like to fix this bug but it isn't clear to me what steps I should be taking. Thanks!

tooltipParent.append(element);

// Check if we should display it or not.
Expand Down