Свойство matchingTarget
Элемент matchingTargetУказатель на элемент, CSS-селектор которого совпал, внутри которого произошло событие. Если это событие не было связано ни с какой делегацией событий, доступ к этому значению вызовет UnsupportedError.
Исходный код
Element get matchingTarget {
if (_selector == null) {
throw new UnsupportedError('Cannot call matchingTarget if this Event did'
' not arise as a result of event delegation.');
}
var currentTarget = this.currentTarget;
var target = this.target;
var matchedTarget;
do {
if (target.matches(_selector)) return target;
target = target.parent;
} while (target != null && target != currentTarget.parent);
throw new StateError('No selector matched for populating matchedTarget.');
}
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-html/KeyEvent/matchingTarget.html