Fix property name collision target_ with Control

* As described in #10158, Control uses the property target_ for
   a custom parent HTMLElement, leading to Events on the Control being
   dispatched with that as the target and not the Control itself.

 * Solved by renaming the target_ property on Target to eventTarget_
This commit is contained in:
Edward Nash
2019-10-22 09:14:07 +02:00
parent ee653a8e0d
commit 9eb4816b27

View File

@@ -40,7 +40,7 @@ class Target extends Disposable {
* @private
* @type {*}
*/
this.target_ = opt_target;
this.eventTarget_ = opt_target;
/**
* @private
@@ -96,7 +96,7 @@ class Target extends Disposable {
const evt = typeof event === 'string' ? new Event(event) : event;
const type = evt.type;
if (!evt.target) {
evt.target = this.target_ || this;
evt.target = this.eventTarget_ || this;
}
const listeners = this.listeners_[type];
let propagate;