Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.
Open
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
25 changes: 24 additions & 1 deletion core-tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<!-- TODO: detect mobile and apply the .large class, instead of manual
control. -->
<!-- TODO: possibly reuse core-overlay. -->
<polymer-element name="core-tooltip" attributes="noarrow position label show tipAttribute" role="tooltip" tabindex="0">
<polymer-element name="core-tooltip" attributes="noarrow position label show tipAttribute" role="tooltip" tabindex="-1">
<template>
<link rel="stylesheet" href="core-tooltip.css">

Expand Down Expand Up @@ -152,6 +152,12 @@
*/
tipAttribute: 'tip',

ready: function() {
// Delegate focus/blur events
Polymer.addEventListener(this, 'focus', this.focusAction.bind(this), true);
Polymer.addEventListener(this, 'blur', this.blurAction.bind(this), true);
},

attached: function() {
this.updatedChildren();
this.resizableAttachedHandler();
Expand Down Expand Up @@ -185,6 +191,23 @@
positionChanged: function(oldVal, newVal) {
this.job('positionJob', this.setPosition);
},

disabledChanged: function() {
this._disabledChanged();
if (!this.disabled) {
this.removeAttribute('tabindex');
}
},

focusAction: function() {
if (!this.disabled) {
this.focused = true;
}
},

blurAction: function() {
this.focused = false;
},

setPosition: function() {
var controlWidth = this.clientWidth;
Expand Down