|
10 | 10 | * @suppress {missingRequire}
|
11 | 11 | */
|
12 | 12 |
|
13 |
| -import {ADD_EVENT_LISTENER_STR, attachOriginToPatched, FALSE_STR, ObjectGetPrototypeOf, REMOVE_EVENT_LISTENER_STR, TRUE_STR, ZONE_SYMBOL_PREFIX, zoneSymbol} from './utils'; |
| 13 | +import {ADD_EVENT_LISTENER_STR, attachOriginToPatched, FALSE_STR, isIEOrEdge, ObjectGetPrototypeOf, REMOVE_EVENT_LISTENER_STR, TRUE_STR, ZONE_SYMBOL_PREFIX, zoneSymbol} from './utils'; |
14 | 14 |
|
15 | 15 | /** @internal **/
|
16 | 16 | interface EventTaskData extends TaskData {
|
17 | 17 | // use global callback or not
|
18 | 18 | readonly useG?: boolean;
|
19 | 19 | }
|
20 | 20 |
|
| 21 | +const pointerEventsMap: {[key: string]: string} = { |
| 22 | + 'pointercancel': 'MSPointerCancel', |
| 23 | + 'pointerdown': 'MSPointerDown', |
| 24 | + 'pointerenter': 'MSPointerEnter', |
| 25 | + 'pointerhover': 'MSPointerHover', |
| 26 | + 'pointerleave': 'MSPointerLeave', |
| 27 | + 'pointermove': 'MSPointerMove', |
| 28 | + 'pointerout': 'MSPointerOut', |
| 29 | + 'pointerover': 'MSPointerOver', |
| 30 | + 'pointerup': 'MSPointerUp' |
| 31 | +}; |
| 32 | + |
21 | 33 | let passiveSupported = false;
|
22 | 34 |
|
23 | 35 | if (typeof window !== 'undefined') {
|
@@ -122,7 +134,12 @@ export function patchEventTarget(
|
122 | 134 | // event.target is needed for Samsung TV and SourceBuffer
|
123 | 135 | // || global is needed https://github.com/angular/zone.js/issues/190
|
124 | 136 | const target: any = this || event.target || _global;
|
125 |
| - const tasks = target[zoneSymbolEventNames[event.type][FALSE_STR]]; |
| 137 | + let tasks = target[zoneSymbolEventNames[event.type][FALSE_STR]]; |
| 138 | + if (!tasks && isIEOrEdge) { |
| 139 | + const pointerMappedEvent = pointerEventsMap[event.type]; |
| 140 | + tasks = |
| 141 | + pointerMappedEvent ? target[zoneSymbolEventNames[pointerMappedEvent]][FALSE_STR] : tasks; |
| 142 | + } |
126 | 143 | if (tasks) {
|
127 | 144 | // invoke all tasks which attached to current target with given event.type and capture = false
|
128 | 145 | // for performance concern, if task.length === 1, just invoke
|
@@ -154,7 +171,12 @@ export function patchEventTarget(
|
154 | 171 | // event.target is needed for Samsung TV and SourceBuffer
|
155 | 172 | // || global is needed https://github.com/angular/zone.js/issues/190
|
156 | 173 | const target: any = this || event.target || _global;
|
157 |
| - const tasks = target[zoneSymbolEventNames[event.type][TRUE_STR]]; |
| 174 | + let tasks = target[zoneSymbolEventNames[event.type][TRUE_STR]]; |
| 175 | + if (!tasks && isIEOrEdge) { |
| 176 | + const pointerMappedEvent = pointerEventsMap[event.type]; |
| 177 | + tasks = |
| 178 | + pointerMappedEvent ? target[zoneSymbolEventNames[pointerMappedEvent]][TRUE_STR] : tasks; |
| 179 | + } |
158 | 180 | if (tasks) {
|
159 | 181 | // invoke all tasks which attached to current target with given event.type and capture = false
|
160 | 182 | // for performance concern, if task.length === 1, just invoke
|
|
0 commit comments