foundation / foundation-sites

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
https://get.foundation
MIT License
29.64k stars 5.5k forks source link

[Dropdown] Allow for multiple anchor toggles. #7433

Closed tjhiggins closed 8 years ago

tjhiggins commented 8 years ago

v5 allowed you to have multiple anchors for the same dropdown. Simplifies the code to only allow one, but is much more efficient to reuse a dropdown with knockoutjs etc.

zurbchris commented 8 years ago

How would you see that implemented in 6? A single dropdown pane that will attach to whichever anchor point was clicked? Then which one does it anchor to for a programmatic open? It also makes aria attributes much more difficult to manage.

tjhiggins commented 8 years ago

@zurbchris A single dropdown pane that will attach to whichever anchor point was clicked? Yes

Then which one does it anchor to for a programmatic open? Default to first anchor, but open could optionally take an anchor?

It also makes aria attributes much more difficult to manage. True, but our use case cannot afford to recreate essentially the same dropdown multiple times. The cleanup logic could be kept generic for all anchors. You would probably need to have a this.$anchors and this.$active_anchor. I was working on a pr, but decided to wait until https://github.com/zurb/foundation-sites/pull/7353 was resolved.

It might be too heavy handed, but we currently utilize that functionality with v5.

andycochran commented 8 years ago

@tjhiggins Now that #7353 is closed, does that help with your PR? I'm going to close this for now. Please reopen if you'd like to submit that PR.