Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Allow closing a dropdown be prevented when certain elements are tapped #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ngrewe
Copy link

@ngrewe ngrewe commented Jan 5, 2015

Hello all the Polymer people!

I think it would be a pretty useful feature to have the ability to prevent core-dropdown-base (and by extension, core-dropdown-menu and paper-dropdown-menu) from closing the overlay when certain elements are tapped. A good example would be a search form to filter the items provided in the dropdown.
I've come up with quite a simple way to do this by providing an attribute (core-dropdown-keep, though I'm not too sure that that's the best name) that you can set on an element in the overlay, which causes the toggleOverlay method to ignore it when it reacts to a tap.

Please let me know what you think about this.

Best regards,

Niels

ngrewe added 2 commits January 5, 2015 10:48
(`core-dropdown-keep') that prevents them from being evaluated for
closing the dropdown on tap. This is useful for instance if you
have a search form, etc. within the dropdown that you want the user
to be able to tap on without closing the menu.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant