Skip to content

Commit

Permalink
Fix navigating to selected/new entries
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Jun 6, 2024
1 parent 5bd031b commit 3456838
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion frontend/viewer/src/ProjectView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
function onEntryCreated(entry: IEntry) {
$entries?.push(entry);//need to add it before refresh, otherwise it won't get selected because it's not in the list
navigateToEntry(entry);
}
function navigateToEntry(entry: IEntry) {
$search = '';
selectEntry(entry);
}
Expand Down Expand Up @@ -147,7 +152,7 @@
</div>
<div class="sm:flex-grow"></div>
<div class="flex-grow-[2] mx-2">
<SearchBar on:entrySelected={(e) => selectEntry(e.detail)} />
<SearchBar on:entrySelected={(e) => navigateToEntry(e.detail)} />
</div>
<div class="flex-grow-[0.25]"></div>
<div slot="actions" class="flex items-center gap-2 sm:gap-4 whitespace-nowrap">
Expand Down
2 changes: 1 addition & 1 deletion frontend/viewer/src/lib/layout/EntryList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</div>
</div>
<div class="border rounded-md overflow-hidden flex">
<div class="overflow-auto w-full">
<div class="overflow-auto w-full" bind:this={scrollContainerElem}>
{#if !entries || entries.length == 0}
<div class="p-4 text-center opacity-75">No entries found</div>
{:else}
Expand Down

0 comments on commit 3456838

Please sign in to comment.