Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dropdown): support autoClose when several dropdowns exist #785

Closed
wants to merge 1 commit into from
Closed

fix(dropdown): support autoClose when several dropdowns exist #785

wants to merge 1 commit into from

Conversation

pkozlowski-opensource
Copy link
Member

The essence of the trick is that now we can distinguish clicks coming from the dropdown toggle element and not interpret those as external clicks.

Fixes #687

*/
set toggleElement(toggleElement: any) { this._toggleElement = toggleElement; }

private _isEventFromToggle($event) { return $event.target === this._toggleElement; }
Copy link
Member

@wesleycho wesleycho Sep 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want this to be this._toggleElement.contains($event.target)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. I want to precisely capture clicks on a toggle button. Changing this to this._toggleElement.contains($event.target) would also capture menu items clicks which is not what we want.

@wesleycho
Copy link
Member

This LGTM

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

Successfully merging this pull request may close these issues.

None yet

2 participants