web/Omnibox: don't rerender omnibox buttons

this prevents unnecessary listener creation on valid/invalid link spam
This commit is contained in:
wukko 2025-04-02 21:22:01 +06:00
parent cc5dff0a30
commit 07d4393d27
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2

View File

@ -170,17 +170,13 @@
disabled={isDisabled} disabled={isDisabled}
/> />
{#if clearVisible} <ClearButton click={() => ($link = "")} />
<ClearButton click={() => ($link = "")} /> <DownloadButton
{/if} url={$link}
{#if downloadable} bind:this={downloadButton}
<DownloadButton bind:disabled={isDisabled}
url={$link} bind:loading={isLoading}
bind:this={downloadButton} />
bind:disabled={isDisabled}
bind:loading={isLoading}
/>
{/if}
</div> </div>
<div id="action-container"> <div id="action-container">
@ -239,6 +235,14 @@
flex: 1; flex: 1;
} }
#input-container:not(.clear-visible) :global(#clear-button) {
display: none;
}
#input-container:not(.downloadable) :global(#download-button) {
display: none;
}
#input-container.clear-visible { #input-container.clear-visible {
padding-right: var(--input-padding); padding-right: var(--input-padding);
} }