Hide tooltip when host is detached
Bug: Issue 5758 Change-Id: Idada8ad3880b515e8222a23da4fac5363e0f9e4d
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
},
|
||||
|
||||
detached: function() {
|
||||
this._handleHideTooltip();
|
||||
this.unlisten(window, 'scroll', '_handleWindowScroll');
|
||||
},
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ limitations under the License.
|
||||
<script src="../../bower_components/webcomponentsjs/webcomponents.min.js"></script>
|
||||
<script src="../../bower_components/web-component-tester/browser.js"></script>
|
||||
|
||||
<link rel="import" href="../../bower_components/iron-test-helpers/iron-test-helpers.html">
|
||||
<link rel="import" href="gr-tooltip-behavior.html">
|
||||
|
||||
<test-fixture id="basic">
|
||||
@@ -108,5 +109,12 @@ limitations under the License.
|
||||
assert.equal(tooltip.style.left, '915px');
|
||||
assert.equal(tooltip.style.top, '100px');
|
||||
});
|
||||
|
||||
test('hides tooltip when detached', function() {
|
||||
sandbox.stub(element, '_handleHideTooltip');
|
||||
element.remove();
|
||||
flushAsynchronousOperations();
|
||||
assert.isTrue(element._handleHideTooltip.called);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user