Spaces:
Running
Running
Scrollable node search list.
Browse files- web/src/NodeSearch.svelte +20 -11
web/src/NodeSearch.svelte
CHANGED
|
@@ -50,17 +50,19 @@ style="top: {pos.top}px; left: {pos.left}px; right: {pos.right}px; bottom: {pos.
|
|
| 50 |
on:keydown={onKeyDown}
|
| 51 |
on:focusout={lostFocus}
|
| 52 |
placeholder="Search for box">
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
</div>
|
| 65 |
|
| 66 |
<style>
|
|
@@ -88,5 +90,12 @@ style="top: {pos.top}px; left: {pos.left}px; right: {pos.right}px; bottom: {pos.
|
|
| 88 |
border-radius: 4px;
|
| 89 |
border: 1px solid #888;
|
| 90 |
background-color: white;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
}
|
| 92 |
</style>
|
|
|
|
| 50 |
on:keydown={onKeyDown}
|
| 51 |
on:focusout={lostFocus}
|
| 52 |
placeholder="Search for box">
|
| 53 |
+
<div class="matches">
|
| 54 |
+
{#each hits as box, index}
|
| 55 |
+
<div
|
| 56 |
+
tabindex="0"
|
| 57 |
+
on:focus={() => selectedIndex = index}
|
| 58 |
+
on:mouseenter={() => selectedIndex = index}
|
| 59 |
+
on:click={addSelected}
|
| 60 |
+
class="search-result"
|
| 61 |
+
class:selected={index == selectedIndex}>
|
| 62 |
+
{box.item.data.title}
|
| 63 |
+
</div>
|
| 64 |
+
{/each}
|
| 65 |
+
</div>
|
| 66 |
</div>
|
| 67 |
|
| 68 |
<style>
|
|
|
|
| 90 |
border-radius: 4px;
|
| 91 |
border: 1px solid #888;
|
| 92 |
background-color: white;
|
| 93 |
+
max-height: -webkit-fill-available;
|
| 94 |
+
max-height: -moz-available;
|
| 95 |
+
display: flex;
|
| 96 |
+
flex-direction: column;
|
| 97 |
+
}
|
| 98 |
+
.matches {
|
| 99 |
+
overflow-y: auto;
|
| 100 |
}
|
| 101 |
</style>
|