Merge pull request #89871 from jeanp413/fix-89857

Fixes cannot undo in SCM input box
This commit is contained in:
João Moreno 2020-02-03 11:46:30 +01:00 committed by GitHub
commit ba74df45d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -769,7 +769,12 @@ export class RepositoryPane extends ViewPane {
// Keep model in sync with API
this.inputModel.setValue(this.repository.input.value);
this._register(this.repository.input.onDidChange(value => this.inputModel.setValue(value)));
this._register(this.repository.input.onDidChange(value => {
if (value === this.inputModel.getValue()) {
return;
}
this.inputModel.setValue(value);
}));
// Keep API in sync with model and update placeholder and validation
toggleClass(placeholderTextContainer, 'hidden', this.inputModel.getValueLength() > 0);