anki/ts/components/Popover.svelte
Henrik Giesel 1ec3741934
Fix outstanding tag editor issues (#1717)
* Start using WithFloating for SelectedTagBadge

* Adjust arrow on WithFloating for all directions

* Move TagOptionsBadge to its own sub directory

* Show autocomplete menu via WithFloating

* Have WithFloating return asReference instead of initializing its own reference element

* Add html: overflow: hidden for editor

* Replace ButtonToolbar with generic div

* Move scroll logic into autocomplete item + restrict Popover width to 95vw

* Fix autocomplete menu after pressing enter after selecting

- should not trigger an autocomplete choose

* Overlap TagInput perfectly with Tag

* Satisfy formatter

* Fix autocompletion item scrolling too much

* Remove unused Tag.svelte focusable prop

* Remove console.log

* Fix floating arrow is a diamond in dark mode

* Set autocompletion menu to 80vw
2022-03-11 15:48:49 +10:00

41 lines
888 B
Svelte

<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
Alternative to DropdownMenu that avoids Bootstrap
-->
<script>
import { pageTheme } from "../sveltelib/theme";
</script>
<div class="popover" class:dark={$pageTheme.isDark} on:mousedown|preventDefault>
<slot />
</div>
<style lang="scss">
.popover {
border-radius: 5px;
background-color: var(--frame-bg);
min-width: 1rem;
max-width: 95vw;
padding: 0.5rem 0;
font-size: 1rem;
color: var(--text-fg);
/* outer border */
border: 1px solid #b6b6b6;
&.dark {
border-color: #060606;
}
/* inner border */
box-shadow: inset 0 0 0 1px #eeeeee;
&.dark {
box-shadow: inset 0 0 0 1px #565656;
}
}
</style>