Skip to content

Commit b082d85

Browse files
committed
Fix regarding issue #11
- Evaluate again inside timeout if toggle is false or true to assure that tooltips are only shown when actions are displayed. - Rolledback to v-show and removed else statement on showTooltip mehotd. - No need to hide tooltips because will be destroyed by v-if when element is removed from dom. - Added 100ms for avoiding delay issues and match animation transition time of 0.7s (maybe more time is needed)
1 parent 19bfd53 commit b082d85

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

dist/build.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/build.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-fab",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Vue Floating Action Button",
55
"main": "src/index.js",
66
"repository": {

src/FAB.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
leave-active-class="animated quick zoomOut"
1414
>
1515
<template v-if="action.tooltip">
16-
<li v-show="toggle" :style="{ 'background-color': action.color || bgColor }"
16+
<li v-if="toggle" :style="{ 'background-color': action.color || bgColor }"
1717
v-tooltip="{ content: action.tooltip, placement: tooltipPosition, classes: 'fab-tooltip', trigger: tooltipTrigger}"
1818
@click="toParent(action.name)" class="pointer"
1919
ref="actions">
@@ -266,14 +266,12 @@
266266
//timeout to prevent wrong position for the tooltip
267267
setTimeout(() => {
268268
this.$refs.actions.forEach((item) => {
269-
item._tooltip.show();
269+
if(this.toggle) {
270+
item._tooltip.show();
271+
}
270272
});
271-
},600);
273+
},700);
272274
273-
}else{
274-
this.$refs.actions.forEach((item) => {
275-
item._tooltip.hide();
276-
});
277275
}
278276
}
279277
},

0 commit comments

Comments
 (0)