Не подтверждена Коммит 4145304f создал по автору Ulugbek Abdullaev's avatar Ulugbek Abdullaev
Просмотр файлов

rename suggestions: fix not showing preview when input box is empty but a...

rename suggestions: fix not showing preview when input box is empty but a rename suggestion is focused
владелец 9f4d6cf8
......@@ -298,9 +298,10 @@ export class RenameInputField implements IContentWidget {
assertType(this._input !== undefined);
assertType(this._candidatesView !== undefined);
const candidateName = this._candidatesView.focusedCandidate;
if ((candidateName === undefined && this._input.value === value) || this._input.value.trim().length === 0) {
this.cancelInput(true, '_currentAcceptInput (because candidateName is undefined or input.value is empty)');
const newName = this._candidatesView.focusedCandidate ?? this._input.value;
if (newName === value || newName.trim().length === 0 /* is just whitespace */) {
this.cancelInput(true, '_currentAcceptInput (because newName === value || newName.trim().length === 0)');
return;
}
......@@ -309,7 +310,7 @@ export class RenameInputField implements IContentWidget {
this._candidatesView.clearCandidates();
resolve({
newName: candidateName ?? this._input.value,
newName,
wantsPreview: supportPreview && wantsPreview
});
};
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать