Skip to content

Commit 6311592

Browse files
committed
fix(core): remove redundant event name splitting
ViewCommon splits event names redundantly (the superclass, Observable, splits event names too).
1 parent b489207 commit 6311592

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

packages/core/ui/core/view/view-common.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ import { SharedTransition, SharedTransitionInteractiveOptions } from '../../tran
3333
// helpers (these are okay re-exported here)
3434
export * from './view-helper';
3535

36-
const eventNamesRegex = /\s*,\s*/;
37-
3836
let animationModule: typeof am;
3937
function ensureAnimationModule() {
4038
if (!animationModule) {
@@ -311,9 +309,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
311309
return;
312310
}
313311

314-
for (const eventName of normalizedName.trim().split(eventNamesRegex)) {
315-
super.addEventListener(eventName, callback, thisArg);
316-
}
312+
super.addEventListener(normalizedName, callback, thisArg);
317313
}
318314

319315
public removeEventListener(arg: string | GestureTypes, callback?: (data: EventData) => void, thisArg?: any) {
@@ -335,9 +331,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
335331
return;
336332
}
337333

338-
for (const eventName of normalizedName.trim().split(eventNamesRegex)) {
339-
super.removeEventListener(eventName, callback, thisArg);
340-
}
334+
super.removeEventListener(normalizedName, callback, thisArg);
341335
}
342336

343337
public onBackPressed(): boolean {

0 commit comments

Comments
 (0)