Skip to content

Commit

Permalink
trigger popper update on menu change state
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilReinking committed Jan 20, 2023
1 parent 63481fa commit 5194287
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deck9/ui",
"version": "0.12.4",
"version": "0.12.5",
"description": "The UI components used in deck9 software applications.",
"author": "Philipp Reinking <[email protected]> (https://deck9.co)",
"scripts": {
Expand Down
9 changes: 6 additions & 3 deletions src/Menu/MenuContainer.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<template>
<Menu as="div" class="relative inline-block text-left">
<Menu as="div" class="relative inline-block text-left" v-slot="{ open }">
<MenuButton class="focus:outline-none" ref="button">
<slot name="button">
<D9Icon class="fill-current" name="ellipsis-h" />
</slot>
</MenuButton>

<teleport :to="typeof usePortal === 'string' ? usePortal : 'body'" :disabled="!usePortal">
<div ref="container" class="w-56">
<teleport
:to="typeof usePortal === 'string' ? usePortal : 'body'"
:disabled="!usePortal"
>
<div ref="container" class="w-56" :class="open ? 'mt-' : 'mt-px'">
<transition
enter-active-class="transition duration-200 ease-in-out"
enter-from-class="transform -translate-y-4 opacity-0"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/usePopper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref, onMounted, watchEffect, Ref, VNode } from "vue";
import { createPopper, Options } from "@popperjs/core/lib/popper-lite.js";
import { createPopper } from "@popperjs/core/lib/popper-lite.js";

export function usePopper(options?: any): [Ref<VNode>, Ref<VNode>] {
const reference = ref(null) as unknown as Ref<VNode>;
Expand Down

0 comments on commit 5194287

Please sign in to comment.