set dropdown aria-label (#8456)

This commit is contained in:
Alan Ren
2019-11-25 13:05:00 -08:00
committed by GitHub
parent 878bcc0d92
commit 0979ce8de6

View File

@@ -102,13 +102,14 @@ export function createCheckbox(view: azdata.ModelView, info: { initialValue: boo
}).component(); }).component();
} }
export function createDropdown(view: azdata.ModelView, info: { defaultValue?: string | azdata.CategoryValue, values?: string[] | azdata.CategoryValue[], width?: string, editable?: boolean, required?: boolean }): azdata.DropDownComponent { export function createDropdown(view: azdata.ModelView, info: { defaultValue?: string | azdata.CategoryValue, values?: string[] | azdata.CategoryValue[], width?: string, editable?: boolean, required?: boolean, label: string }): azdata.DropDownComponent {
return view.modelBuilder.dropDown().withProperties<azdata.DropDownProperties>({ return view.modelBuilder.dropDown().withProperties<azdata.DropDownProperties>({
values: info.values, values: info.values,
value: info.defaultValue, value: info.defaultValue,
width: info.width, width: info.width,
editable: info.editable, editable: info.editable,
fireOnTextChange: true fireOnTextChange: true,
ariaLabel: info.label
}).component(); }).component();
} }
@@ -271,7 +272,8 @@ function processOptionsTypeField(context: FieldContext): void {
defaultValue: context.fieldInfo.defaultValue, defaultValue: context.fieldInfo.defaultValue,
width: context.fieldInfo.inputWidth, width: context.fieldInfo.inputWidth,
editable: context.fieldInfo.editable, editable: context.fieldInfo.editable,
required: context.fieldInfo.required required: context.fieldInfo.required,
label: context.fieldInfo.label
}); });
context.onNewInputComponentCreated(context.fieldInfo.variableName!, dropdown); context.onNewInputComponentCreated(context.fieldInfo.variableName!, dropdown);
addLabelInputPairToContainer(context.view, context.components, label, dropdown, context.fieldInfo.labelPosition); addLabelInputPairToContainer(context.view, context.components, label, dropdown, context.fieldInfo.labelPosition);