Skip to content

Commit

Permalink
fix(search): make keyboard shortcut works again
Browse files Browse the repository at this point in the history
  • Loading branch information
bastienwirtz committed Jul 15, 2024
1 parent fe25fb0 commit 6c43829
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 67 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@fortawesome/fontawesome-free": "^6.5.2",
"bulma": "^1.0.1",
"lodash.merge": "^4.6.2",
"vue": "^3.4.26",
"vue": "^3.4.31",
"yaml": "^2.4.5"
},
"devDependencies": {
Expand All @@ -29,5 +29,5 @@
"vite-plugin-pwa": "^0.20.0"
},
"license": "Apache-2.0",
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
"packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
}
130 changes: 70 additions & 60 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
:hotkey="searchHotkey()"
@input="filterServices($event)"
@search-focus="showMenu = true"
@search-open="navigateToFirstService($event?.target?.value)"
@search-open="navigateToFirstService"
@search-cancel="filterServices()"
/>
</Navbar>
Expand Down Expand Up @@ -276,11 +276,10 @@ export default {
const service = this.services[0].items[0];
window.open(service.url, target || service.target || "_self");
} catch (error) {
console.warning("fail to open service");
console.warn("fail to open service");
}
},
filterServices: function (filter) {
console.log(filter);
this.filter = filter;
if (!filter) {
Expand Down
6 changes: 4 additions & 2 deletions src/components/SearchInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
<form role="search">
<label for="search" class="search-label"></label>
<input
id="search"
name="search"
type="search"
ref="search"
:value="value"
@input.stop="search($event.target.value)"
@keyup.enter.exact="open()"
@keyup.alt.enter="open('_blank')"
@keydown.enter.exact.prevent="open()"
@keydown.alt.enter.prevent="open('_blank')"
/>
</form>
</search>
Expand Down

0 comments on commit 6c43829

Please sign in to comment.