Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/tooltip/helpers/bv-popper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
},
Expand Down
6 changes: 5 additions & 1 deletion src/utils/safe-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}