Return an HTML search screen from /search for browser visits and point the bottom nav Search tab at it instead of the dashboard. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+9
-3
@@ -136,14 +136,20 @@ Alpine.data('afia', (config = {}) => ({
|
||||
}));
|
||||
|
||||
Alpine.data('topbarSearch', (config = {}) => ({
|
||||
query: '',
|
||||
results: [],
|
||||
open: false,
|
||||
query: config.initialQuery || '',
|
||||
results: Array.isArray(config.initialResults) ? config.initialResults : [],
|
||||
open: !!config.openOnInit,
|
||||
loading: false,
|
||||
active: 0,
|
||||
_abort: null,
|
||||
searchUrl: config.searchUrl || '/search',
|
||||
|
||||
init() {
|
||||
if (config.autoFocus) {
|
||||
this.$nextTick(() => this.$refs.input?.focus());
|
||||
}
|
||||
},
|
||||
|
||||
onFocus() {
|
||||
if (this.results.length > 0 || this.query.trim().length >= 2) this.open = true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user