From 3334e2af3de2844de08ee530e62f2e4e2fd7ed24 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 3 Jan 2024 16:51:20 +0100 Subject: [PATCH] fix(Popover): allow manual mode without blocking normal behaviour --- .../content/examples/PopoverExampleOpen.vue | 25 ++++++------- .../examples/PopoverExampleOverlay.vue | 18 +++++----- docs/content/6.overlays/3.popover.md | 6 +--- src/runtime/components/overlays/Popover.vue | 36 ++++++++++++++----- 4 files changed, 49 insertions(+), 36 deletions(-) diff --git a/docs/components/content/examples/PopoverExampleOpen.vue b/docs/components/content/examples/PopoverExampleOpen.vue index 98ee0651..41fc3470 100644 --- a/docs/components/content/examples/PopoverExampleOpen.vue +++ b/docs/components/content/examples/PopoverExampleOpen.vue @@ -1,18 +1,19 @@ diff --git a/docs/components/content/examples/PopoverExampleOverlay.vue b/docs/components/content/examples/PopoverExampleOverlay.vue index c829d78c..908e023f 100644 --- a/docs/components/content/examples/PopoverExampleOverlay.vue +++ b/docs/components/content/examples/PopoverExampleOverlay.vue @@ -1,13 +1,11 @@ diff --git a/docs/content/6.overlays/3.popover.md b/docs/content/6.overlays/3.popover.md index 31346e8d..2c810118 100644 --- a/docs/content/6.overlays/3.popover.md +++ b/docs/content/6.overlays/3.popover.md @@ -21,7 +21,7 @@ Use the `mode` prop to switch between `click` and `hover` modes. ### Manual -Use the `open` prop to manually control showing the panel. +Use a `v-model:open` to manually control the state. In this example, press :shortcut{value="O"} to toggle the popover. :component-example{component="popover-example-open"} @@ -29,10 +29,6 @@ Use the `open` prop to manually control showing the panel. :component-example{component="popover-example-overlay"} -::callout{icon="i-heroicons-light-bulb"} - Clicking on the `overlay` emits `update:open`. If you are manually controlling the `open` prop, you will need to use a [`v-model` argument](https://vuejs.org/guide/components/v-model.html#v-model-arguments) (`v-model:open`). -:: - ## Popper Use the `popper` prop to customize the popper instance. diff --git a/src/runtime/components/overlays/Popover.vue b/src/runtime/components/overlays/Popover.vue index 44299957..aa579d0b 100644 --- a/src/runtime/components/overlays/Popover.vue +++ b/src/runtime/components/overlays/Popover.vue @@ -1,5 +1,6 @@