Adding aria-live label support for input boxes (#6862)

* Adding aria-live support for InputBoxes

* Adding aria-live setting for DacFx wizard InputBox control

* Dud commit to unstick Github CI
This commit is contained in:
Benjin Dubishar
2019-08-22 14:01:19 -07:00
committed by GitHub
parent ab9c4e0cbd
commit 887b2bfd2b
5 changed files with 22 additions and 2 deletions

1
src/sql/azdata.d.ts vendored
View File

@@ -2890,6 +2890,7 @@ declare module 'azdata' {
export interface InputBoxProperties extends ComponentProperties {
value?: string;
ariaLabel?: string;
ariaLive?: string;
placeHolder?: string;
inputType?: InputBoxInputType;
required?: boolean;

View File

@@ -96,6 +96,10 @@ export class InputBox extends vsInputBox {
}
}
public set ariaLive(value: string) {
this.element.setAttribute('aria-live', value);
}
public isEnabled(): boolean {
return !this.inputElement.hasAttribute('disabled');
}

View File

@@ -767,6 +767,13 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone
this.setProperty('ariaLabel', v);
}
public get ariaLive(): string {
return this.properties['ariaLive'];
}
public set ariaLive(v: string) {
this.setProperty('ariaLabel', v);
}
public get placeHolder(): string {
return this.properties['placeHolder'];
}

View File

@@ -204,6 +204,9 @@ export default class InputBoxComponent extends ComponentBase implements ICompone
}
}
if (this.ariaLive) {
input.ariaLive = this.ariaLive;
}
input.inputElement.required = this.required;
}
@@ -226,6 +229,10 @@ export default class InputBoxComponent extends ComponentBase implements ICompone
this.setPropertyFromUI<azdata.InputBoxProperties, string>((props, value) => props.ariaLabel = value, newValue);
}
public get ariaLive() {
return this.getPropertyOrDefault<azdata.InputBoxProperties, string>((props) => props.ariaLive, '');
}
public get placeHolder(): string {
return this.getPropertyOrDefault<azdata.InputBoxProperties, string>((props) => props.placeHolder, '');
}