fix input box issues (#15587)

This commit is contained in:
Alan Ren
2021-05-27 09:35:59 -07:00
committed by GitHub
parent b75e688a7e
commit 3946cee33c
4 changed files with 30 additions and 0 deletions

View File

@@ -222,6 +222,7 @@ export default class InputBoxComponent extends ComponentBase<azdata.InputBoxProp
input.setAriaLabel(this.ariaLabel);
input.setPlaceHolder(this.placeHolder);
input.setEnabled(this.enabled);
input.setMaxLength(this.maxLength);
this.layoutInputBox();
if (this.multiline) {
if (isNumber(this.rows)) {
@@ -347,6 +348,10 @@ export default class InputBoxComponent extends ComponentBase<azdata.InputBoxProp
this.setPropertyFromUI<boolean>((props, value) => props.stopEnterPropagation = value, newValue);
}
public get maxLength(): number | undefined {
return this.getPropertyOrDefault<number | undefined>((props) => props.maxLength, undefined);
}
public focus(): void {
this.inputElement.focus();
}