3 /** @polymerBehavior */
5 Polymer.IronControlState = {
10 * If true, the element currently has focus.
21 reflectToAttribute: true
25 * If true, the user cannot interact with this element.
35 observer: '_disabledChanged',
36 reflectToAttribute: true
45 '_changedControlState(focused, disabled)'
49 focus: '_focusHandler',
54 // TODO(sjmiles): ensure read-only property is valued so the compound
56 if (this.focused === undefined) {
57 this._setFocused(false);
61 _focusHandler: function() {
62 this._setFocused(true);
65 _blurHandler: function() {
66 this._setFocused(false);
69 _disabledChanged: function(disabled, old) {
70 this.setAttribute('aria-disabled', disabled ? 'true' : 'false');
71 this.style.pointerEvents = disabled ? 'none' : '';
73 this._oldTabIndex = this.tabIndex;
76 } else if (this._oldTabIndex !== undefined) {
77 this.tabIndex = this._oldTabIndex;
81 _changedControlState: function() {
82 // _controlStateChanged is abstract, follow-on behaviors may implement it
83 if (this._controlStateChanged) {
84 this._controlStateChanged();