Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

mdMenu: invalid comparison in menu-iterim-element.js #3252

Closed
Frank3K opened this issue Jun 13, 2015 · 1 comment
Closed

mdMenu: invalid comparison in menu-iterim-element.js #3252

Frank3K opened this issue Jun 13, 2015 · 1 comment
Assignees
Milestone

Comments

@Frank3K
Copy link
Contributor

Frank3K commented Jun 13, 2015

In menu-interim-element.js there is an invalid comparison in the onclick-handler of the menuContentEl. Line #157 (058efeb) contains the following check:

 do {
    if (target && target.hasAttribute('ng-click')) {
      ...
    }
  } while ((target = target.parentNode) && target != opts.menuContentEl)

target is here a native DOM element, whereas opts.menuContentEl is a jqLite object. Therefore the comparison is always true. This can lead to an error since target can now become (in given conditions) equal to document, which does not have a hasAttribute method.

@Frank3K
Copy link
Contributor Author

Frank3K commented Jun 16, 2015

Furthermore, this loop lacks support for data-ng-click and x-ng-click.

I see this is also reported as #3258.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants