Skip to content

Commit

Permalink
Migrate from v-tooltip to floating-vue
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Jul 24, 2022
1 parent c48aa17 commit f08754e
Show file tree
Hide file tree
Showing 10 changed files with 215 additions and 233 deletions.
128 changes: 69 additions & 59 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"debounce": "1.2.1",
"emoji-mart-vue-fast": "^11.1.1",
"escape-html": "^1.0.3",
"floating-vue": "^1.0.0-beta.18",
"focus-trap": "^6.8.1",
"hammerjs": "^2.0.8",
"linkify-string": "^3.0.2",
Expand All @@ -59,7 +60,6 @@
"style-loader": "^3.3.1",
"tributejs": "^5.1.3",
"v-click-outside": "^3.0.1",
"v-tooltip": "^2.0.3",
"vue": "^2.6.14",
"vue-color": "^2.7.1",
"vue-material-design-icons": "^5.0.0",
Expand Down
24 changes: 6 additions & 18 deletions src/components/Actions/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ export default {
<!-- If more than one action, create a popovermenu -->
<Popover :delay="0"
:handle-resize="true"
:open.sync="opened"
:shown.sync="opened"
:placement="placement"
:boundaries-element="boundariesElement"
:boundary="boundariesElement"
:container="container"
popover-base-class="action-item__popover"
popover-base-class="action-item__popper"
@show="openMenu"
@after-show="onOpen"
@hide="closeMenu">
Expand Down Expand Up @@ -519,7 +519,7 @@ export default {
this.$emit('update:open', true)
/**
* Event emitted when the popover menu is closed
* Event emitted when the popover menu is opened
*/
this.$emit('open')
},
Expand Down Expand Up @@ -781,25 +781,13 @@ export default {
}
}
}
.popover__inner ul {
padding: 4px;
}
.ie,
.edge {
.action-item__menu,
.action-item__menu .action-item__menu_arrow {
border: 1px solid var(--color-border);
}
}
</style>
<style lang="scss">
// We overwrote the popover base class, so we can style
// the popover__inner for actions only.
.popover.action-item__popover .popover__inner {
.v-popper__popper.action-item__popper .v-popper__inner {
border-radius: var(--border-radius-large);
padding: 4px;
}
</style>
2 changes: 1 addition & 1 deletion src/components/Avatar/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ export default {
&--with-menu {
cursor: pointer;
::v-deep .trigger {
::v-deep .v-popper {
position: absolute;
top: 0;
left: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ColorPicker/ColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default {
<template>
<div class="container1">
<button @click="open = !open"> Click Me </button>
<ColorPicker :value="color" @input="updateColor" :open.sync="open">
<ColorPicker :value="color" @input="updateColor" :shown.sync="open">
<div :style="{'background-color': color}" class="color1" />
</ColorPicker>
</div>
Expand Down
25 changes: 4 additions & 21 deletions src/components/EmojiPicker/EmojiPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
```vue
<template>
<div>
<EmojiPicker @select="select">
<EmojiPicker @select="select" style="display: inline-block">
<button> Click Me </button>
</EmojiPicker>
<span>selected emoji: {{ emoji }}</span>
Expand Down Expand Up @@ -62,7 +62,8 @@
<EmojiPicker
:close-on-select="false"
:show-preview="true"
@select="select">
@select="select"
style="display: inline-block">
<button> Click Me </button>
</EmojiPicker>
<span>selected emoji: {{ emoji }}</span>
Expand All @@ -87,10 +88,8 @@
</docs>

<template>
<Popover :open.sync="open"
<Popover :shown.sync="open"
:container="container"
popover-class="emoji-popover"
popover-inner-class="popover-emoji-picker-inner"
v-bind="$attrs"
v-on="$listeners"
@after-show="afterShow"
Expand Down Expand Up @@ -264,22 +263,6 @@ export default {
<style lang="scss">
@import '~emoji-mart-vue-fast/css/emoji-mart.css';
.emoji-popover {
& .tooltip-arrow,
&[x-placement^='top'] {
margin-left: 0 !important;
}
& .tooltip-arrow,
&[x-placement^='bottom'] {
margin-top: 0 !important;
}
// Remove the extra padding from VTooltip
.popover-emoji-picker-inner {
padding: 0;
}
}
.emoji-mart {
background-color: var(--color-main-background) !important;
border: 0;
Expand Down
Loading

0 comments on commit f08754e

Please sign in to comment.