Skip to content

Commit

Permalink
Auto-select focused search text
Browse files Browse the repository at this point in the history
  • Loading branch information
kaubu committed Dec 17, 2023
1 parent e341cbb commit fd95481
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/components/SearchResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ const instance = getCurrentInstance();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
watch(route, (_to, _from) => {
console.log("Force updated!");
refreshSearch();
instance?.proxy?.$forceUpdate();
});
Expand Down
3 changes: 2 additions & 1 deletion src/layouts/default/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function searchWord() {
}
onMounted(() => {
const searchBar = document.getElementById("searchBar");
const searchBar = document.getElementById("searchBar") as HTMLInputElement;
// const wordlistSearch = document.getElementById("wordlistSearch");
window.addEventListener("keyup", (e) => {
Expand All @@ -56,6 +56,7 @@ onMounted(() => {
&& (document.activeElement?.id !== "wordlistSearch")) {
// console.log(`Focusing search! activeElement = ${document.activeElement?.id}`);
searchBar?.focus();
searchBar?.select();
// Unfocus the search bar if escape is pressed
} else if (e.code === "Escape" && (document.activeElement === searchBar)) {
searchBar?.blur();
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<p><sub>This project is still in progress, expect errors.</sub></p>

<p><sub>v1.6.1 (2023-12-17)</sub></p>
<p><sub>v1.6.2 (2023-12-17)</sub></p>
</center>
</template>

Expand Down

0 comments on commit fd95481

Please sign in to comment.