Spec-Zone.ru › Dart 2

dart:html

свойство matchingTarget

Element 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.');
  }
  Element? currentTarget = this.currentTarget as Element?;
  Element? target = this.target as Element?;
  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 BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-html/KeyEvent/matchingTarget.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API