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:
@@ -40,7 +40,7 @@ class Target extends Disposable {
|
|||||||
* @private
|
* @private
|
||||||
* @type {*}
|
* @type {*}
|
||||||
*/
|
*/
|
||||||
this.target_ = opt_target;
|
this.eventTarget_ = opt_target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -96,7 +96,7 @@ class Target extends Disposable {
|
|||||||
const evt = typeof event === 'string' ? new Event(event) : event;
|
const evt = typeof event === 'string' ? new Event(event) : event;
|
||||||
const type = evt.type;
|
const type = evt.type;
|
||||||
if (!evt.target) {
|
if (!evt.target) {
|
||||||
evt.target = this.target_ || this;
|
evt.target = this.eventTarget_ || this;
|
||||||
}
|
}
|
||||||
const listeners = this.listeners_[type];
|
const listeners = this.listeners_[type];
|
||||||
let propagate;
|
let propagate;
|
||||||
|
|||||||
Reference in New Issue
Block a user