hekigan / vue-directive-tooltip

Vue.js tooltip directive. Easy to use, configure and style
https://hekigan.github.io/vue-directive-tooltip/
MIT License
173 stars 33 forks source link

v-tooltip="val" throws errors when `val === null` #27

Closed diachedelic closed 6 years ago

diachedelic commented 6 years ago

Bug

Example: https://codepen.io/anon/pen/LegZBe

Behaviour

Current:

v-tooltip breaks when its value resolved to null or undefined.

Expected:

v-tooltip should wait until value is not null or undefined, then continue with normal behaviour.

Please mention other relevant information:

[Vue warn]: Error in directive tooltip inserted hook: \\"TypeError: Cannot read property \'delay\' of undefined\\"\\n\\nfound in\\n\\n---> ...

TypeError: Cannot read property \'delay\' of undefined\n    at filterBindings (webpack-internal:///503:2839:37)\n    at inserted (webpack-internal:///503:2817:31)\n    at callHook$1 (webpack-internal:///1:6147:7)\n    at callInsert (webpack-internal:///1:6089:9)\n    at wrappedHook (webpack-internal:///1:2039:10)\n    at Object.invoker [as insert] (webpack-internal:///1:1983:19)\n    at invokeInsertHook (webpack-internal:///1:5817:28)\n    at VueComponent.patch [as __patch__] (webpack-internal:///1:6036:5)\n    at VueComponent.Vue._update (webpack-internal:///1:2627:19)\n    at VueComponent.updateComponent (webpack-internal:///1:2745:10)',

[Vue warn]: Error in directive tooltip unbind hook: \\"TypeError: Cannot read property \'destroy\' of undefined\\"\\n\\nfound in\\n\\n---> ...

TypeError: Cannot read property \'destroy\' of undefined\n    at unbind (webpack-internal:///503:2832:28)\n    at callHook$1 (webpack-internal:///1:6147:7)\n    at _update (webpack-internal:///1:6111:9)\n    at updateDirectives (webpack-internal:///1:6053:5)\n    at Array.unbindDirectives (webpack-internal:///1:6047:5)\n    at invokeDestroyHook (webpack-internal:///1:5616:64)\n    at invokeDestroyHook (webpack-internal:///1:5620:9)\n    at invokeDestroyHook (webpack-internal:///1:5620:9)\n    at invokeDestroyHook (webpack-internal:///1:5620:9)\n    at VueComponent.patch [as __patch__] (webpack-internal:///1:5938:30)',
hekigan commented 6 years ago

You are right, that should be a quick fix

hekigan commented 6 years ago

This fix is in the new version: 1.4.3