dart-archive / angular_analyzer_plugin

WORK MOVED TO dart-lang/angular repository
https://github.com/dart-lang/angular/tree/master/angular_analyzer_plugin
68 stars 13 forks source link

dblclick not recognized #615

Open cooler-king opened 6 years ago

cooler-king commented 6 years ago
warning: The bound output dblclick does not exist on any directives or on the element (nonexist_output_bound at ...)

Got this warning with a (dblclick) event handler on a td element. There are (click), (mouseenter) and (mouseleave) event handlers on the same element that do not trigger any warning.

Is this a valid warning?

MichaelRFairhurst commented 6 years ago

Thanks for filing!

This does appear to be a false warning. While dart:html uses onDoubleClick (https://api.dartlang.org/stable/2.0.0/dart-html/Element/onDoubleClick.html), that doesn't match the event name in the DOM API (https://developer.mozilla.org/en-US/docs/Web/Events/dblclick), which angular uses (https://github.com/dart-lang/angular/blob/67d1bd06a152956e315d443042ef9da646e57552/angular/lib/src/compiler/html_events.dart#L26).

We use dart:html so that we have type information of the $event variable. Previously dart:html had a DomName annotation we used to get event names, that, in this case, matched DoubleClick to dblClick. However it was removed https://github.com/dart-lang/sdk/commit/8fedfc7f8c8e5c8a869f82cf60b3deec79f383c3 and we now go by method name only.

Thanks for filing! I'll get working on this.