Fixed empty search input when going from InFile to Vault
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function selectInput() {
|
async function selectInput() {
|
||||||
|
await tick()
|
||||||
elInput.focus()
|
elInput.focus()
|
||||||
await tick()
|
await tick()
|
||||||
elInput.select()
|
elInput.select()
|
||||||
|
|||||||
@@ -62,8 +62,6 @@
|
|||||||
groupedOffsets = groups.map(group =>
|
groupedOffsets = groups.map(group =>
|
||||||
Math.round((group.first()!.offset + group.last()!.offset) / 2)
|
Math.round((group.first()!.offset + group.last()!.offset) / 2)
|
||||||
)
|
)
|
||||||
// console.log(groups)
|
|
||||||
// console.log(groupedOffsets)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +143,7 @@
|
|||||||
<InputSearch
|
<InputSearch
|
||||||
on:input="{e => (searchQuery = e.detail)}"
|
on:input="{e => (searchQuery = e.detail)}"
|
||||||
placeholder="Omnisearch - File"
|
placeholder="Omnisearch - File"
|
||||||
value="{searchQuery}"/>
|
initialValue="{searchQuery}"/>
|
||||||
|
|
||||||
<ModalContainer>
|
<ModalContainer>
|
||||||
{#if groupedOffsets.length && note}
|
{#if groupedOffsets.length && note}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
import { Query } from 'src/search/query'
|
import { Query } from 'src/search/query'
|
||||||
import { settings } from '../settings'
|
import { settings } from '../settings'
|
||||||
import * as NotesIndex from '../notes-index'
|
import * as NotesIndex from '../notes-index'
|
||||||
import { cacheManager } from "../cache-manager"
|
import { cacheManager } from '../cache-manager'
|
||||||
|
|
||||||
export let modal: OmnisearchVaultModal
|
export let modal: OmnisearchVaultModal
|
||||||
let selectedIndex = 0
|
let selectedIndex = 0
|
||||||
@@ -31,8 +31,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await NotesIndex.refreshIndex()
|
|
||||||
previousQuery = (await cacheManager.getSearchHistory())[historySearchIndex]
|
|
||||||
eventBus.enable('vault')
|
eventBus.enable('vault')
|
||||||
eventBus.on('vault', 'enter', openNoteAndCloseModal)
|
eventBus.on('vault', 'enter', openNoteAndCloseModal)
|
||||||
eventBus.on('vault', 'create-note', createNoteAndCloseModal)
|
eventBus.on('vault', 'create-note', createNoteAndCloseModal)
|
||||||
@@ -43,6 +41,8 @@
|
|||||||
eventBus.on('vault', 'arrow-down', () => moveIndex(1))
|
eventBus.on('vault', 'arrow-down', () => moveIndex(1))
|
||||||
eventBus.on('vault', 'prev-search-history', prevSearchHistory)
|
eventBus.on('vault', 'prev-search-history', prevSearchHistory)
|
||||||
eventBus.on('vault', 'next-search-history', nextSearchHistory)
|
eventBus.on('vault', 'next-search-history', nextSearchHistory)
|
||||||
|
await NotesIndex.refreshIndex()
|
||||||
|
previousQuery = (await cacheManager.getSearchHistory())[0]
|
||||||
})
|
})
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user