Skip to content
Permalink
Browse files

fix(b-tooltip/b-popover): add `SVGElement` as acceptable prop type (c…

…loses #4173) (#4174)
  • Loading branch information...
tmorehouse committed Sep 30, 2019
1 parent e6c39c4 commit fab7fea0a69b36b95f0c9606122140fe771e8ac8
Showing with 9 additions and 5 deletions.
  1. +2 −2 src/components/tooltip/helpers/bv-popper.js
  2. +2 −2 src/components/tooltip/tooltip.js
  3. +5 −1 src/utils/safe-types.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: {
@@ -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
},
@@ -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 {}

0 comments on commit fab7fea

Please sign in to comment.
You can’t perform that action at this time.