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

mdMenu: add option to stop propagation when opening menu #3296

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

mdMenu: add option to stop propagation when opening menu #3296

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

Comments

@Frank3K
Copy link
Contributor

Frank3K commented Jun 16, 2015

Currently, an md-menu can be opened by setting ng-click="$mdOpenMenu()" on the button opener element. If one of the parents of the md-menu element also has a click-handler that handler is also triggered, which is not always the desired behaviour.

It would be nice if the $mdOpenMenu method could be configured such that it does stop the propagation of the click event, e.g. by calling $mdOpenMenu($event, true). For now, I have manually added a method stopPropagation on each scope in which I am using a menu. By using ng-click="stopPropagation(); $mdOpenMenu()"the same effect then can be reached.

@ThomasBurleson
Copy link
Contributor

I think the click to open the menu should never propogate; since it is used to trigger the menu open only.

@ThomasBurleson ThomasBurleson modified the milestones: 0.10.1, 0.11.0 Jun 16, 2015
Frank3K added a commit to Frank3K/material that referenced this issue Jun 17, 2015
Do not propagate the event in mdOpenMenu. This way a menu can be nested in elements that also have handlers of the same event type, without triggering any of these events. To enable this functionality, `$event` should be passed as the first argument to `$mdOpenMenu`.

Fixes angular#3296.
kseamon added a commit to kseamon/material that referenced this issue Jun 18, 2015
Implements a virtual repeater to use instead of ng-repeat for substantially
better performance in components.

review edits

Make tests pass in FF.

fix(tabs): prevents error on empty tab list

Closes angular#3264

fix(button): fixes button styles for components that override their default styles

chore(toast): fix type typo in toast docs (`boolean` > `string`).

fix(utils): update for Angular 1.4.1 compatibility

Fixes angular#3315, Fixes angular#3325.

fix(icons): improve use of material-icons style

Improve logic to auto-add `.material-icons` style to **md-icon**.
> NOTE: will not auto-add if using any class or ng-class attributes; see demoFontIconsWithLigatures

Fixes angular#3333.

update(icon): removed **ddescribe** used for isolated karma tests

update(docs, icon): clarify auto-add of 'material-icons' style.

update(build): use of Angular v1.4.1

update(util): update initOptionalProperties() implementation

Closes angular#3316.

feat(menu): do not propagate event in mdOpenMenu

Do not propagate the event in mdOpenMenu. This way a menu can be nested in elements that also have handlers of the same event type, without triggering any of these events. To enable this functionality, `$event` should be passed as the first argument to `$mdOpenMenu`.

Fixes angular#3296. Closes angular#3332.

update(tests, mocks):  test for stopPropogation

angular-material-mocks captures $timeout.flush() errors.
add menu event propogation test

Switched RawGit for GitCDN

Switch to GitCDN, which lets you get the latest master branch, without losing the CDN and without it's service getting harmed.

Closes angular#3262.

update(README): change docs to reference 0.10.0

Closes angular#3319.
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