WIP Search places by category

This commit is contained in:
2026-03-20 15:40:03 +04:00
parent 6b37508f66
commit f2a2d910a0
10 changed files with 350 additions and 11 deletions

View File

@@ -27,6 +27,10 @@ export default class SearchBoxComponent extends Component {
@action
handleInput(event) {
this.query = event.target.value;
if (this.args.onQueryChange) {
this.args.onQueryChange(this.query);
}
if (this.query.length < 2) {
this.results = [];
return;
@@ -35,6 +39,7 @@ export default class SearchBoxComponent extends Component {
this.searchTask.perform();
}
searchTask = task({ restartable: true }, async () => {
await timeout(300);
@@ -121,8 +126,10 @@ export default class SearchBoxComponent extends Component {
clear() {
this.query = '';
this.results = [];
this.router.transitionTo('index'); // Or stay on current page?
// Usually clear just clears the input.
if (this.args.onQueryChange) {
this.args.onQueryChange('');
}
this.router.transitionTo('index');
}
<template>