Skip to content

Commit 4089a58

Browse files
committed
Merge branch 'main' of https://github.com/cdmoro/bootstrap-vue-3 into cdmoro-main
2 parents b301b91 + 6548fa5 commit 4089a58

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [0.1.20](https://github.com/cdmoro/bootstrap-vue-3/compare/v0.1.19...v0.1.20) (2022-07-21)
6+
7+
8+
### Bug Fixes
9+
10+
* propagate `delay` as a component prop ([21dfc79](https://github.com/cdmoro/bootstrap-vue-3/commit/21dfc79c8eac60a8e315488013c381ffe5f3facb))
11+
512
## [0.1.19](https://github.com/cdmoro/bootstrap-vue-3/compare/v0.1.18...v0.1.19) (2022-07-13)
613

714

packages/bootstrap-vue-3/src/components/BToast/BToast.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {BLINK_PROPS} from '../BLink/BLink.vue'
1919
import {BodyProp} from './plugin'
2020
2121
export const SLOT_NAME_TOAST_TITLE = 'toast-title'
22-
const MIN_DURATION = 5000
22+
const MIN_DURATION = 1000
2323
2424
export default defineComponent({
2525
props: {

packages/bootstrap-vue-3/src/components/BToast/BToaster.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:id="toast.options.id"
66
:key="toast.options.id"
77
v-model="toast.options.value"
8+
:delay="toast.options.delay"
89
:title="toast.content.title"
910
:body="toast.content.body"
1011
:component="toast.content.body"

packages/bootstrap-vue-3/src/directives/BTooltip.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/ban-ts-comment */
12
import {Directive, DirectiveBinding} from 'vue'
23
import Tooltip from 'bootstrap/js/dist/tooltip'
34

@@ -64,23 +65,30 @@ const BTooltip: Directive<HTMLElement> = {
6465
const trigger = resolveTrigger(binding.modifiers)
6566
const placement = resolvePlacement(binding.modifiers)
6667
const delay = resolveDelay(binding.value)
68+
const title = el.getAttribute('title')
6769

6870
new Tooltip(el, {
6971
trigger,
7072
placement,
7173
delay,
7274
html: isHtml,
7375
})
76+
77+
if (title) {
78+
el.setAttribute('data-bs-original-title', title)
79+
}
7480
},
7581
updated(el) {
7682
const title = el.getAttribute('title')
83+
const originalTitle = el.getAttribute('data-bs-original-title')
84+
const instance = Tooltip.getInstance(el)
85+
86+
el.removeAttribute('title')
7787

78-
if (title !== '') {
79-
const instance = Tooltip.getInstance(el)
80-
instance?.toggle()
81-
el.setAttribute('data-bs-original-title', title || '')
82-
el.setAttribute('title', '')
83-
instance?.toggle()
88+
if (title && title !== originalTitle) {
89+
// @ts-ignore
90+
instance?.setContent({'.tooltip-inner': title})
91+
el.setAttribute('data-bs-original-title', title)
8492
}
8593
},
8694
unmounted(el) {

0 commit comments

Comments
 (0)