mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
fix input box issues (#15587)
This commit is contained in:
@@ -1074,6 +1074,14 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone
|
||||
this.setProperty('validationErrorMessage', v);
|
||||
}
|
||||
|
||||
public get maxLength(): number | undefined {
|
||||
return this.properties['maxLength'];
|
||||
}
|
||||
|
||||
public set maxLength(v: number | undefined) {
|
||||
this.setProperty('maxLength', v);
|
||||
}
|
||||
|
||||
public get onTextChanged(): vscode.Event<any> {
|
||||
let emitter = this._emitterMap.get(ComponentEventType.onDidChange);
|
||||
return emitter && emitter.event;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user