diff --git a/src/lib/components/dropList.svelte b/src/lib/components/dropList.svelte
index 2cf75c7da..4098110b1 100644
--- a/src/lib/components/dropList.svelte
+++ b/src/lib/components/dropList.svelte
@@ -11,39 +11,23 @@
type Placement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
let element: HTMLDivElement;
let tooltip: HTMLDivElement;
+ let arrow: HTMLDivElement;
let instance: Instance;
- let currentArrow: Placement;
-
- $: [arrowHorizontal, arrowPosition] = applyArrow(currentArrow);
-
- function applyArrow(value: Placement): [string: 'start' | 'end', string: 'top' | 'bottom'] {
- switch (value) {
- case 'bottom-start':
- return ['start', 'bottom'];
- case 'bottom-end':
- return ['end', 'bottom'];
- case 'top-start':
- return ['start', 'top'];
- case 'top-end':
- return ['end', 'top'];
- default:
- return ['start', 'bottom'];
- }
- }
onMount(() => {
instance = createPopper(element, tooltip, {
placement,
- onFirstUpdate(state) {
- if (currentArrow !== state.placement) {
- currentArrow = state.placement as Placement;
- }
- },
modifiers: [
+ {
+ name: 'arrow',
+ options: {
+ element: arrow
+ }
+ },
{
name: 'offset',
options: {
- offset: [0, noArrow ? 0 : 12]
+ offset: [0, noArrow ? 0 : 6]
}
},
{
@@ -51,16 +35,6 @@
options: {
fallbackPlacements: ['top-start', 'top-end', 'bottom-start', 'bottom-end']
}
- },
- {
- name: 'placementLogger',
- enabled: true,
- phase: 'main',
- fn({ state }) {
- if (currentArrow !== state.placement) {
- currentArrow = state.placement as Placement;
- }
- }
}
]
});
@@ -87,16 +61,10 @@