Skip to content

document.onClick returns an EventStream instead of an ElementEventStream #14814

Open
@DartBot

Description

This issue was originally filed by googlegroups...@kaioa.com


import 'dart:html';

void main() {
  print(document.onClick.runtimeType);
  // _EventStream
  print(document.body.onClick.runtimeType);
  // _ElementEventStreamImpl
}

With jQuery, event delegation also works if you use document instead of document.body. With Dart, this doesn't work.

document.onClick (EventStream) doesn't have a "matches" function.

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-webUse area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.library-htmltype-enhancementA request for a change that isn't a bugweb-librariesIssues impacting dart:html, etc., libraries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions