mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
Adjust position so tags do not even move a single pixel when going into editing
This commit is contained in:
parent
6642a11482
commit
9499bc1505
3 changed files with 51 additions and 47 deletions
|
@ -54,7 +54,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<svelte:body on:keydown={setDeleteIcon} on:keyup={setDeleteIcon} />
|
||||
|
||||
<button
|
||||
class={`tag btn d-inline-flex align-items-center text-nowrap rounded ps-2 pe-1 ${className}`}
|
||||
class={`tag btn d-inline-flex align-items-center text-nowrap rounded ps-2 pe-1 m-0 ${className}`}
|
||||
class:selected
|
||||
class:flashing
|
||||
class:select-mode={selectMode}
|
||||
|
|
|
@ -362,7 +362,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
{size}
|
||||
on:focusout={deselectIfLeave}
|
||||
>
|
||||
<div class="pad" on:mousedown|preventDefault>
|
||||
<div class="gap" on:mousedown|preventDefault>
|
||||
{#if tags.some((tag) => tag.selected)}
|
||||
<SelectedTagBadge
|
||||
on:tagcopy={copySelectedTags}
|
||||
|
@ -374,7 +374,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
</div>
|
||||
|
||||
{#each tags as tag, index (tag.id)}
|
||||
<div class="position-relative pad" class:hide-tag={index === active}>
|
||||
<div class="position-relative gap" class:hide-tag={index === active}>
|
||||
<Tag
|
||||
class="me-1"
|
||||
name={tag.name}
|
||||
|
@ -393,6 +393,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
/>
|
||||
|
||||
{#if index === active}
|
||||
<div class="adjust-position">
|
||||
<WithAutocomplete
|
||||
class="d-flex flex-column-reverse dropup"
|
||||
{suggestionsPromise}
|
||||
|
@ -404,7 +405,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
>
|
||||
<TagInput
|
||||
id={tag.id}
|
||||
class="position-absolute top-0 start-0"
|
||||
class="tag-input position-absolute top-0 start-0 ps-2 py-0"
|
||||
bind:name={activeName}
|
||||
bind:input={activeInput}
|
||||
on:focus={() => {
|
||||
|
@ -432,6 +433,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
}}
|
||||
/>
|
||||
</WithAutocomplete>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
|
@ -452,7 +454,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
opacity: 0;
|
||||
}
|
||||
|
||||
.pad {
|
||||
padding-bottom: 0.15rem;
|
||||
.gap {
|
||||
margin-bottom: 0.15rem;
|
||||
}
|
||||
|
||||
.adjust-position :global(.tag-input) {
|
||||
/* recreates positioning of Tag component */
|
||||
border-left: 1px solid transparent;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -192,9 +192,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
<style lang="scss">
|
||||
input {
|
||||
padding-left: 9.5px;
|
||||
padding-bottom: 5.5px;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
|
|
Loading…
Reference in a new issue