File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import CONSTANT from "../constant";
6
6
const dispatchGlobalEvent = ( eventName , opts ) => {
7
7
// Compatible with IE
8
8
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
9
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
9
10
let event ;
10
11
11
12
if ( typeof window . CustomEvent === "function" ) {
@@ -52,10 +53,11 @@ export default function(target) {
52
53
53
54
target . prototype . globalShow = function ( event ) {
54
55
if ( this . mount ) {
56
+ const hasTarget =
57
+ ( event && event . detail && event . detail . target && true ) || false ;
55
58
// Create a fake event, specific show will limit the type to `solid`
56
59
// only `float` type cares e.clientX e.clientY
57
- const e = { currentTarget : event . detail . target } ;
58
- this . showTooltip ( e , true ) ;
60
+ this . showTooltip ( { currentTarget : hasTarget && event . detail . target } , true ) ;
59
61
}
60
62
} ;
61
63
You can’t perform that action at this time.
0 commit comments