From c3a390235c695a2fcfc2793914412cdfb507c746 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Mon, 30 Sep 2019 17:07:55 -0300 Subject: [PATCH 1/3] fix(b-tooltip/b-popover): Add SVGElement as acceptable prop type --- src/utils/safe-types.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/safe-types.js b/src/utils/safe-types.js index a0264359644..fd1abdca2cb 100644 --- a/src/utils/safe-types.js +++ b/src/utils/safe-types.js @@ -6,6 +6,10 @@ import { hasWindowSupport } from './env' const w = hasWindowSupport ? window : {} -export const HTMLElement = hasWindowSupport ? w.HTMLElement : class HTMLElement extends Object {} +export const Element = hasWindowSupport ? w.Element : class Element extends Object {} + +export const HTMLElement = hasWindowSupport ? w.HTMLElement : class HTMLElement extends Element {} + +export const SVGElement = hasWindowSupport ? w.SVGElement : class SVGElement extends Element {} export const File = hasWindowSupport ? w.File : class File extends Object {} From a0cf44de0e9f7f24fd7d19dba31bec71314b9b38 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Mon, 30 Sep 2019 17:11:34 -0300 Subject: [PATCH 2/3] Update tooltip.js --- src/components/tooltip/tooltip.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tooltip/tooltip.js b/src/components/tooltip/tooltip.js index a883dcf723c..88a1797803a 100644 --- a/src/components/tooltip/tooltip.js +++ b/src/components/tooltip/tooltip.js @@ -3,7 +3,7 @@ import getScopId from '../../utils/get-scope-id' import { isArray, arrayIncludes } from '../../utils/array' import { getComponentConfig } from '../../utils/config' import { isString, isUndefinedOrNull } from '../../utils/inspect' -import { HTMLElement } from '../../utils/safe-types' +import { HTMLElement, SVGElement } from '../../utils/safe-types' import { BVTooltip } from './helpers/bv-tooltip' const NAME = 'BTooltip' @@ -24,7 +24,7 @@ export const BTooltip = /*#__PURE__*/ Vue.extend({ target: { // String ID of element, or element/component reference // Or function that returns one of the above - type: [String, HTMLElement, Function, Object], + type: [String, HTMLElement, SVGElement, Function, Object], // default: undefined, required: true }, From 89cd5bf1e9537e4966c4a26538aafb69327272a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Mon, 30 Sep 2019 22:26:31 +0200 Subject: [PATCH 3/3] Update bv-popper.js --- src/components/tooltip/helpers/bv-popper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tooltip/helpers/bv-popper.js b/src/components/tooltip/helpers/bv-popper.js index ef2178d62fd..77f4c87d876 100644 --- a/src/components/tooltip/helpers/bv-popper.js +++ b/src/components/tooltip/helpers/bv-popper.js @@ -8,7 +8,7 @@ import Vue from '../../../utils/vue' import Popper from 'popper.js' import { getCS, select } from '../../../utils/dom' -import { HTMLElement } from '../../../utils/safe-types' +import { HTMLElement, SVGElement } from '../../../utils/safe-types' import { BVTransition } from '../../../utils/bv-transition' const NAME = 'BVPopper' @@ -51,7 +51,7 @@ export const BVPopper = /*#__PURE__*/ Vue.extend({ props: { target: { // Element that the tooltip/popover is positioned relative to - type: HTMLElement, + type: [HTMLElement, SVGElement], default: null }, placement: {