Skip to content

Cannot register DOMSubtreeModified through "on" #2937

Closed
@peter-ahe-google

Description

@peter-ahe-google

See the full program below. This works:

  div.$dom_addEventListener('DOMSubtreeModified', update);

This doesn't:

  div.on['DOMSubtreeModified'].add(update);

By "work" I mean that "got event" is not printed in the console.

<!DOCTYPE html>
<html>
  <head>
    <title>Bug</title>
  </head>
  <body>
    <script type="application/dart">

import('dart:html', prefix: 'html');

update(_) => print('got event');

main() {
  final div = html.document.query('#mydiv');
  // div.$dom_addEventListener('DOMSubtreeModified', update);
  div.on['DOMSubtreeModified'].add(update);
  div.nodes.add(new html.Element.html('<a href="index.html">home</a>'));
}
    </script>
    <div id="mydiv"></div>
  </body>
</html>

Metadata

Metadata

Assignees

Labels

closed-obsoleteClosed as the reported issue is no longer relevantweb-librariesIssues impacting dart:html, etc., libraries

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions