Skip to content

Commit 996a0e9

Browse files
committed
Remove error style from FindAndReplace and GoToLine dialogs when they contain no input text (Fixes #220)
1 parent 877e596 commit 996a0e9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

plugins/find-and-replace.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ codeInput.plugins.FindAndReplace = class extends codeInput.Plugin {
123123
// No matches - error
124124
dialog.findInput.classList.add('code-input_find-and-replace_error');
125125
}
126+
} else {
127+
// Input box is empty - no error
128+
dialog.findInput.classList.remove('code-input_find-and-replace_error');
126129
}
127130
this.updateMatchDescription(dialog);
128131
}

plugins/go-to-line.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ codeInput.plugins.GoToLine = class extends codeInput.Plugin {
8181
}
8282
}
8383
} else {
84-
// No value
84+
// No value, so no message or error
8585
dialog.guidance.textContent = "";
86+
dialog.input.classList.remove('code-input_go-to-line_error');
8687
}
8788

8889
if (event.key == 'Enter') {

0 commit comments

Comments
 (0)