@spectrum-web-components/shared
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -25,3 +25,3 @@ import { LitElement, CSSResultArray, PropertyValues } from 'lit-element'; | ||
private newTabindex?; | ||
private oldTabindex?; | ||
private oldTabindex; | ||
readonly focusElement: HTMLElement; | ||
@@ -28,0 +28,0 @@ focus(): void; |
@@ -43,2 +43,4 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.isShiftTabbing = false; | ||
this.newTabindex = 0; | ||
this.oldTabindex = 0; | ||
} | ||
@@ -61,5 +63,2 @@ static get styles() { | ||
firstUpdated() { | ||
if (!this.hasAttribute('tabindex')) { | ||
this.tabIndex = 0; | ||
} | ||
if (this.autofocus) { | ||
@@ -124,5 +123,3 @@ this.focus(); | ||
else if (oldDisabled) { | ||
if (this.oldTabindex !== undefined) { | ||
this.tabIndex = this.oldTabindex; | ||
} | ||
this.tabIndex = this.oldTabindex; | ||
this.removeAttribute('aria-disabled'); | ||
@@ -129,0 +126,0 @@ } |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "", | ||
@@ -39,3 +39,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "3d7176f688fee7746b52556ecba4df15c2342948" | ||
"gitHead": "5112887821c1408c1c4121949a4f91743c98ff6a" | ||
} |
@@ -34,3 +34,3 @@ /* | ||
@property({ type: Boolean, reflect: true }) | ||
public disabled: boolean = false; | ||
public disabled = false; | ||
@@ -41,3 +41,3 @@ /** | ||
@property({ type: Boolean }) | ||
public autofocus: boolean = false; | ||
public autofocus = false; | ||
@@ -49,7 +49,7 @@ /** | ||
@property({ type: Number, reflect: true }) | ||
public tabIndex: number = 0; | ||
public tabIndex = 0; | ||
private isShiftTabbing: boolean = false; | ||
private newTabindex?: number; | ||
private oldTabindex?: number; | ||
private isShiftTabbing = false; | ||
private newTabindex?: number = 0; | ||
private oldTabindex = 0; | ||
@@ -73,6 +73,2 @@ public get focusElement(): HTMLElement { | ||
protected firstUpdated(): void { | ||
if (!this.hasAttribute('tabindex')) { | ||
this.tabIndex = 0; | ||
} | ||
if (this.autofocus) { | ||
@@ -156,5 +152,3 @@ this.focus(); | ||
} else if (oldDisabled) { | ||
if (this.oldTabindex !== undefined) { | ||
this.tabIndex = this.oldTabindex; | ||
} | ||
this.tabIndex = this.oldTabindex; | ||
this.removeAttribute('aria-disabled'); | ||
@@ -161,0 +155,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17
43603
475