mirror of
https://github.com/decaf-dev/obsidian-vault-explorer.git
synced 2026-07-22 05:11:41 +00:00
Merge pull request #357 from decaf-dev/fix-clear-button
Fix clear button
This commit is contained in:
commit
dff36bdca2
1 changed files with 31 additions and 26 deletions
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
function closeDropdown() {
|
||||
isOpen = false;
|
||||
inputValue = "";
|
||||
inputValue = value;
|
||||
currentFocusIndex = 0;
|
||||
}
|
||||
|
||||
|
|
@ -157,22 +157,31 @@
|
|||
bind:this={dropdownRef}
|
||||
use:portalAction
|
||||
>
|
||||
{#each filteredOptions as option, i}
|
||||
<div
|
||||
tabindex="-1"
|
||||
role="option"
|
||||
aria-selected={option === value}
|
||||
class="vault-explorer-search-select__dropdown-item"
|
||||
class:vault-explorer-search-select__dropdown-item--selected={currentFocusIndex ===
|
||||
i}
|
||||
on:mousedown={handleOptionMouseDown}
|
||||
on:click={(e) => handleOptionClick(option)}
|
||||
on:keydown={() => {}}
|
||||
>
|
||||
{option}
|
||||
</div>
|
||||
{/each}
|
||||
{#if filteredOptions.length > 0}
|
||||
<div class="vault-explorer-search-select__dropdown-container">
|
||||
{#each filteredOptions as option, i}
|
||||
<div
|
||||
tabindex="-1"
|
||||
role="option"
|
||||
aria-selected={option === value}
|
||||
class="vault-explorer-search-select__dropdown-item"
|
||||
class:vault-explorer-search-select__dropdown-item--selected={currentFocusIndex ===
|
||||
i}
|
||||
on:mousedown={handleOptionMouseDown}
|
||||
on:click={(e) => handleOptionClick(option)}
|
||||
on:keydown={() => {}}
|
||||
>
|
||||
{option}
|
||||
</div>
|
||||
{/each}
|
||||
{#if filteredOptions.length === 0}
|
||||
<div
|
||||
class="vault-explorer-search-select__dropdown-item vault-explorer-search-select__dropdown-item--empty"
|
||||
>
|
||||
No results found
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if value !== ""}
|
||||
<Divider />
|
||||
<div
|
||||
tabindex="-1"
|
||||
|
|
@ -186,13 +195,6 @@
|
|||
Clear
|
||||
</div>
|
||||
{/if}
|
||||
{#if filteredOptions.length === 0}
|
||||
<div
|
||||
class="vault-explorer-search-select__dropdown-item vault-explorer-search-select__dropdown-item--empty"
|
||||
>
|
||||
No results found
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
@ -211,8 +213,6 @@
|
|||
position: absolute;
|
||||
background-color: var(--dropdown-background);
|
||||
box-shadow: var(--input-shadow);
|
||||
max-height: 175px;
|
||||
overflow-y: auto;
|
||||
z-index: 999;
|
||||
color: var(--text-normal);
|
||||
font-size: var(--font-ui-small);
|
||||
|
|
@ -221,6 +221,11 @@
|
|||
border-radius: var(--input-radius);
|
||||
}
|
||||
|
||||
.vault-explorer-search-select__dropdown-container {
|
||||
max-height: 145px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.vault-explorer-search-select__input-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
|
|
|||
Loading…
Reference in a new issue