diff --git a/apps/dialtone-documentation/docs/components/hovercard.md b/apps/dialtone-documentation/docs/components/hovercard.md index bc4be3c41b..463f8b4954 100644 --- a/apps/dialtone-documentation/docs/components/hovercard.md +++ b/apps/dialtone-documentation/docs/components/hovercard.md @@ -69,8 +69,6 @@ showHtmlWarning /> ### Many hovercards -Initially, there is a 300ms delay when numerous hovercards are present. However, when transitioning from one anchor to another, the delay is determined by the mouse movement time. This implies that the closer the anchors are, the faster the hovercard appears. To achieve this, the component uses a global timer. Move the mouse over the avatars to reveal the hovercards in the example. - diff --git a/packages/dialtone-vue2/components/hovercard/hovercard.stories.js b/packages/dialtone-vue2/components/hovercard/hovercard.stories.js index c384d3e8b9..dd67551769 100644 --- a/packages/dialtone-vue2/components/hovercard/hovercard.stories.js +++ b/packages/dialtone-vue2/components/hovercard/hovercard.stories.js @@ -50,6 +50,11 @@ export const argTypesData = { }, // Props + open: { + control: { + type: 'boolean', + }, + }, fallbackPlacements: { description: `If the popover does not fit in the direction described by "placement", it will attempt to change its direction to the "fallbackPlacements". diff --git a/packages/dialtone-vue2/components/hovercard/hovercard.test.js b/packages/dialtone-vue2/components/hovercard/hovercard.test.js index 09997382b2..733cd50c2a 100644 --- a/packages/dialtone-vue2/components/hovercard/hovercard.test.js +++ b/packages/dialtone-vue2/components/hovercard/hovercard.test.js @@ -94,9 +94,8 @@ describe('DtHovercard Tests', () => { await anchor.trigger('mouseleave'); await vi.runAllTimers(); - content = getHovercardContent(); - - expect(content).toBeNull(); + const dialog = document.querySelector('[data-qa="dt-hovercard__dialog"] > div'); + expect(dialog.style.display).toBe('none'); }); }); diff --git a/packages/dialtone-vue2/components/hovercard/hovercard.vue b/packages/dialtone-vue2/components/hovercard/hovercard.vue index b7c53f3d07..d91159cfa1 100644 --- a/packages/dialtone-vue2/components/hovercard/hovercard.vue +++ b/packages/dialtone-vue2/components/hovercard/hovercard.vue @@ -14,8 +14,10 @@ :footer-class="footerClass" :append-to="appendTo" :hovercard="true" - :timer="timer" data-qa="dt-hovercard" + :open="open" + :enter-delay="enterDelay" + :leave-delay="leaveDelay" @opened="(e) => ($emit('opened', e))" >