Skip to content

Commit

Permalink
handle undefined data attrs (#3)
Browse files Browse the repository at this point in the history
* handle undefined data attrs

* using && to check for undefined attrs
  • Loading branch information
coxy authored and egoist committed Sep 26, 2017
1 parent 62950c3 commit 9470a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tippy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const hasBindingChanged = (value, oldValue) => {
export default (opts = {}) => {
const init = (el, { value = {}, oldValue = {} }, vnode) => {
if (!el.getAttribute('title')) {
const title = value.title || vnode.data.attrs.title || opts.title
const title = value.title || vnode.data.attrs && vnode.data.attrs.title || opts.title
if (title) {
el.setAttribute('title', title)
}
Expand Down

0 comments on commit 9470a16

Please sign in to comment.