未验证 提交 9d5f18eb 编写于 作者: J Joao Moreno

repo pane: keep scm input in sync with API

上级 c47d20b3
......@@ -762,19 +762,17 @@ export class RepositoryPane extends ViewPane {
accessor.addZone({ afterLineNumber: 0, domNode: $('div'), heightInPx: 3 });
});
this._register(this.inputModel.onDidChangeContent(triggerValidation));
this._register(this.inputEditor.onDidChangeCursorPosition(triggerValidation));
// const onKeyUp = domEvent(this.inputBox.inputElement, 'keyup');
// const onMouseUp = domEvent(this.inputBox.inputElement, 'mouseup');
// this._register(Event.any<any>(onKeyUp, onMouseUp)(triggerValidation, null));
// this.inputBox.value = this.repository.input.value;
// this._register(this.inputBox.onDidChange(value => this.repository.input.value = value, null));
// this._register(this.repository.input.onDidChange(value => this.inputBox.value = value, null));
// Keep model in sync with API
this.inputModel.setValue(this.repository.input.value);
this._register(this.repository.input.onDidChange(value => this.inputModel.setValue(value)));
// Keep API in sync with model and update placeholder and validation
this.inputModel.onDidChangeContent(() => {
this.repository.input.value = this.inputModel.getValue();
toggleClass(placeholderTextContainer, 'hidden', this.inputModel.getValueLength() > 0);
triggerValidation();
});
updatePlaceholder();
......
......@@ -18,6 +18,10 @@ class SCMInput implements ISCMInput {
}
set value(value: string) {
if (value === this._value) {
return;
}
this._value = value;
this._onDidChange.fire(value);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册