Skip to content

Commit

Permalink
siw: add placeholder for glob inputs (#12389)
Browse files Browse the repository at this point in the history
The commit adds a placeholder (visible on focus) for the search-in-workspace (siw) glob input fields, namely `include` and `exclude`. The behavior is consistent with VS Code.

Signed-off-by: FernandoAscencio <fernando.ascencio.cama@ericsson.com>
  • Loading branch information
FernandoAscencio authored Apr 10, 2023
1 parent ceb48a5 commit 8f0755d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,10 @@ export class SearchInWorkspaceWidget extends BaseWidget implements StatefulWidge
defaultValue={value}
autoComplete='off'
id={kind + '-glob-field'}
placeholder={kind === 'include'
? nls.localizeByDefault('e.g. *.ts, src/**/include')
: nls.localizeByDefault('e.g. *.ts, src/**/exclude')
}
onKeyUp={e => {
if (e.target) {
const targetValue = (e.target as HTMLInputElement).value || '';
Expand Down
4 changes: 4 additions & 0 deletions packages/search-in-workspace/src/browser/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
font-size: var(--theia-ui-font-size0);
}

.t-siw-search-container .searchHeader .glob-field-container .glob-field .theia-input:not(:focus)::placeholder {
color: transparent;
}

.t-siw-search-container .resultContainer {
height: 100%;
margin-left: 13px;
Expand Down

0 comments on commit 8f0755d

Please sign in to comment.