document.onClick returns an EventStream instead of an ElementEventStream #14814
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
library-html
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
web-libraries
Issues impacting dart:html, etc., libraries
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 ofdocument.body
. With Dart, this doesn't work.document.onClick
(EventStream) doesn't have a "matches" function.The text was updated successfully, but these errors were encountered: