Fix for propagating aria-label title of form components to loading component (#8051)

This commit is contained in:
Charles Gagnon
2019-10-28 14:48:47 -07:00
committed by GitHub
parent 15fd37e049
commit fa79e5b016
2 changed files with 7 additions and 6 deletions

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

@@ -3010,6 +3010,10 @@ declare module 'azdata' {
* Corresponds to the display CSS property for the element * Corresponds to the display CSS property for the element
*/ */
display?: DisplayType; display?: DisplayType;
/**
* Corresponds to the aria-label accessibility attribute for this component
*/
ariaLabel?: string;
/** /**
* Matches the CSS style key and its available values. * Matches the CSS style key and its available values.
*/ */
@@ -3024,7 +3028,6 @@ declare module 'azdata' {
export interface InputBoxProperties extends ComponentProperties { export interface InputBoxProperties extends ComponentProperties {
value?: string; value?: string;
ariaLabel?: string;
ariaLive?: string; ariaLive?: string;
placeHolder?: string; placeHolder?: string;
inputType?: InputBoxInputType; inputType?: InputBoxInputType;
@@ -3147,7 +3150,6 @@ declare module 'azdata' {
values?: string[] | CategoryValue[]; values?: string[] | CategoryValue[];
editable?: boolean; editable?: boolean;
fireOnTextChange?: boolean; fireOnTextChange?: boolean;
ariaLabel?: string;
required?: boolean; required?: boolean;
} }
@@ -3226,10 +3228,6 @@ declare module 'azdata' {
* The title for the button. This title will show when hovered over * The title for the button. This title will show when hovered over
*/ */
title?: string; title?: string;
/**
* The accessibility aria label for this component
*/
ariaLabel?: string;
} }
export interface LoadingComponentProperties { export interface LoadingComponentProperties {

View File

@@ -331,6 +331,9 @@ class FormContainerBuilder extends GenericContainerBuilder<azdata.FormContainer,
} }
if (formComponent.title && componentWrapper) { if (formComponent.title && componentWrapper) {
componentWrapper.ariaLabel = formComponent.title; componentWrapper.ariaLabel = formComponent.title;
if (componentWrapper instanceof LoadingComponentWrapper) {
componentWrapper.component.ariaLabel = formComponent.title;
}
} }
let actions: string[] = undefined; let actions: string[] = undefined;
if (formComponent.actions) { if (formComponent.actions) {