Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

The "typeof element.oninput" changes with Zone.js (object vs. function) #540

@mkdynamic

Description

@mkdynamic

Test case to reproduce:

<!DOCTYPE html>
<html>
  <body>
    <script>
      var test = function() {
        var input = document.createElement("input");
        input.setAttribute("oninput", "return");
        return typeof input.oninput;
      };

      document.write("<div>before zone.js: " + test() + "</div>");
    </script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.7.2/zone.min.js"></script>

    <script>
      document.write("<div>after zone.js: " + test() + "</div>");
    </script>
  </body>
</html>

This outputs the following:

before zone.js: function
after zone.js: object

This breaks Modernizr’s feature detection for "oninput" (it assumed a function type):
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/event/oninput.js#L29

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions