mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 09:35:37 -05:00
Add ability to handle enter key propagation for input model components (#7524)
* Add ability to stop enter key propagation for input model components * Fix spacing * onInputEntered -> onEnterKeyPressed
This commit is contained in:
@@ -769,6 +769,7 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone
|
||||
super(proxy, handle, ModelComponentTypes.InputBox, id);
|
||||
this.properties = {};
|
||||
this._emitterMap.set(ComponentEventType.onDidChange, new Emitter<any>());
|
||||
this._emitterMap.set(ComponentEventType.onEnterKeyPressed, new Emitter<string>());
|
||||
}
|
||||
|
||||
public get value(): string {
|
||||
@@ -841,10 +842,22 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone
|
||||
this.setProperty('inputType', v);
|
||||
}
|
||||
|
||||
public get stopEnterPropagation(): boolean {
|
||||
return this.properties['stopEnterPropagation'];
|
||||
}
|
||||
public set stopEnterPropagation(v: boolean) {
|
||||
this.setProperty('stopEnterPropagation', v);
|
||||
}
|
||||
|
||||
public get onTextChanged(): vscode.Event<any> {
|
||||
let emitter = this._emitterMap.get(ComponentEventType.onDidChange);
|
||||
return emitter && emitter.event;
|
||||
}
|
||||
|
||||
public get onEnterKeyPressed(): vscode.Event<string> {
|
||||
const emitter = this._emitterMap.get(ComponentEventType.onEnterKeyPressed);
|
||||
return emitter && emitter.event;
|
||||
}
|
||||
}
|
||||
|
||||
class CheckBoxWrapper extends ComponentWrapper implements azdata.CheckBoxComponent {
|
||||
|
||||
Reference in New Issue
Block a user