Skip to content

Commit c98896a

Browse files
simhof-basyskomHannia Valera
andauthored
Make autofocus on search field in cache view work (#4552)
* Replace "autofocus" with .focus() in onload handler This sets the focus to the search/filter input field when opening the CMake Cache view. * Amend changelog as requested by contribution guidelines * fixing version so that it is up to date --------- Co-authored-by: Hannia Valera <[email protected]>
1 parent 8fff019 commit c98896a

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Bugs:
1919
- Fix bug in which clicking "Run Test" for filtered tests executed all tests instead [#4501](https://github.com/microsoft/vscode-cmake-tools/pull/4501) [@hippo91](https://github.com/hippo91)
2020
- Migrate macOS CI from deprecated macOS-13 to macOS-15 Image [#4633](https://github.com/microsoft/vscode-cmake-tools/pull/4633)
2121
- Ensure Visual Studio developer environment propagation preserves `VCPKG_ROOT`, enabling vcpkg-dependent configure runs after using the Set Visual Studio Developer Environment command. [microsoft/vscode-cpptools#14083](https://github.com/microsoft/vscode-cpptools/issues/14083)
22+
- Fix auto-focusing the "Search" input field in the CMake Cache view. [#4552](https://github.com/microsoft/vscode-cmake-tools/pull/4552) [@simhof-basyskom](https://github.com/simhof-basyskom)
23+
2224

2325
## 1.21
2426

src/ui/cacheView.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,14 +470,15 @@ export class ConfigurationWebview {
470470
validateInput(editbox)
471471
editbox.oninput = () => edit(editbox);
472472
});
473+
document.querySelector('#search').focus();
473474
}
474475
</script>
475476
</head>
476477
<body>
477478
<div class="container">
478479
<button id="save" onclick="save()">${saveButtonText}</button>
479480
<h1>${this.cmakeCacheEditorText}<span class="invisible" id="not-saved">*</span></h1>
480-
<input class="search" type="text" id="search" oninput="search()" placeholder="${searchButtonText}" autofocus>
481+
<input class="search" type="text" id="search" oninput="search()" placeholder="${searchButtonText}">
481482
<table style="width:100%">
482483
<tr style="height: 25px;">
483484
<th style="width: 30px"></th>

0 commit comments

Comments
 (0)