Skip to content

Commit

Permalink
Fix popouts not working (#3028)
Browse files Browse the repository at this point in the history
* Attempt at fixing popouts? no idea if will work

* Try with no theme?

* Revert "Try with no theme?"

This reverts commit 7fb3a6c.

* Try to remove triggers from theme

* Remove duplicate plugin

* Fix version issue

* Try to remove theme and use default theme

* Add back theme for later fixing

* Lint

---------

Co-authored-by: Geometrically <[email protected]>
  • Loading branch information
Prospector and Geometrically authored Dec 15, 2024
1 parent 24271a2 commit 283a915
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 67 deletions.
1 change: 0 additions & 1 deletion apps/app-frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ app.use(FloatingVue, {
placement: 'bottom-end',
instantMove: true,
distance: 8,
triggers: ['click'],
},
},
})
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"ansi-to-html": "^0.7.2",
"dayjs": "^1.11.7",
"dompurify": "^3.1.7",
"floating-vue": "2.0.0-beta.20",
"floating-vue": "^5.2.2",
"fuse.js": "^6.6.2",
"highlight.js": "^11.7.0",
"iso-3166-1": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/plugins/floating-vue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FloatingVue from "floating-vue";
import "floating-vue/dist/style.css";

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(FloatingVue, {
Expand All @@ -8,7 +9,6 @@ export default defineNuxtPlugin((nuxtApp) => {
placement: "bottom-end",
instantMove: true,
distance: 8,
triggers: ["click"],
},
},
});
Expand Down
6 changes: 0 additions & 6 deletions apps/frontend/src/plugins/tooltip.js

This file was deleted.

17 changes: 9 additions & 8 deletions packages/assets/styles/classes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1205,22 +1205,23 @@ select {
border-top-right-radius: var(--radius-md) !important;
}

.v-popper--theme-dropdown,
.v-popper--theme-dropdown.v-popper--theme-ribbit-popout {
.v-popper__inner {
border: 1px solid var(--color-button-bg);
padding: var(--gap-sm);
width: fit-content;
border-radius: var(--radius-md);
background-color: var(--color-raised-bg);
box-shadow: var(--shadow-floating);
border: 1px solid var(--color-button-bg) !important;
padding: var(--gap-sm) !important;
width: fit-content !important;
border-radius: var(--radius-md) !important;
background-color: var(--color-raised-bg) !important;
box-shadow: var(--shadow-floating) !important;
}

.v-popper__arrow-outer {
border-color: var(--color-button-bg);
border-color: var(--color-button-bg) !important;
}

.v-popper__arrow-inner {
border-color: var(--color-raised-bg);
border-color: var(--color-raised-bg) !important;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/markdown-it": "^14.1.1",
"apexcharts": "^3.44.0",
"dayjs": "^1.11.10",
"floating-vue": "2.0.0-beta.24",
"floating-vue": "^5.2.2",
"highlight.js": "^11.9.0",
"markdown-it": "^13.0.2",
"qrcode.vue": "^3.4.1",
Expand Down
9 changes: 4 additions & 5 deletions packages/ui/src/components/base/PopoutMenu.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<Dropdown
ref="dropdown"
theme="ribbit-popout"
no-auto-focus
:aria-id="dropdownId || null"
@hide="focusTrigger"
Expand All @@ -10,19 +9,19 @@
<button ref="trigger" v-bind="$attrs" v-tooltip="tooltip">
<slot></slot>
</button>
<template #popper="{ hide }">
<button class="dummy-button" @focusin="hideAndFocusTrigger(hide)"></button>
<template #popper="{ hide: hideFunction }">
<button class="dummy-button" @focusin="hideAndFocusTrigger(hideFunction)"></button>
<div ref="menu" class="contents">
<slot name="menu"> </slot>
</div>
<button class="dummy-button" @focusin="hideAndFocusTrigger(hide)"></button>
<button class="dummy-button" @focusin="hideAndFocusTrigger(hideFunction)"></button>
</template>
</Dropdown>
</template>

<script setup>
import { Dropdown } from 'floating-vue'
import { ref, defineOptions } from 'vue'
import { ref } from 'vue'
const trigger = ref()
const menu = ref()
Expand Down
64 changes: 20 additions & 44 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 283a915

Please sign in to comment.