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

Action Sheets break inside Menu Bars #520

Open
Joe-5mith opened this issue Mar 10, 2015 · 6 comments
Open

Action Sheets break inside Menu Bars #520

Joe-5mith opened this issue Mar 10, 2015 · 6 comments

Comments

@Joe-5mith
Copy link

There are two issues here:

  1. The action sheet flashes onto the screen and disappears quickly when the toggle link is pushed ("Menu Link 1" in the the example code below).
  2. The action sheet causes the menu container (the menu-group div in the example code below) to scroll and the action sheet gets hidden inside that container.

Here is some example code:

<div class="menu-group primary">
            <div class="menu-group-left">
                <ul class="menu-bar">
                    <li><a href="#"><strong>Sometext</strong></a></li>
                </ul>
            </div>
            <div class="menu-group-right">
                <ul class="menu-bar">
                    <li>
                        <a href="#" zf-toggle="my-actionsheet">Menu Link 1</a>
                        <zf-action-sheet id="my-actionsheet">
<!--                            <zf-as-button>my button goes here</zf-as-button>-->
                            <zf-as-content position="bottom">
                                My content goes here
                            </zf-as-content>
                        </zf-action-sheet>
                    </li>
                </ul>
            </div>
        </div>

See also: #496
and: http://foundation.zurb.com/forum/posts/21216-foundation-for-apps-action-sheets-in-nav.

@gakimball
Copy link
Contributor

Here are the problems:

  • The menu bar is hiding overflowing content. We can fix that with overflow-y: hidden, and it shouldn't break anything else.
  • The action sheet container isn't centered within the menu bar item. It's anchored to the right instead, like a normal element would be. You can fix that with position: relative; left: 50%;. I'm not sure how to elegantly build that fix into the framework.

Applying those fixes will make the action sheet visible.

screen shot 2015-04-22 at 6 37 05 pm

However, since it's anchored so far to the right it will be cut off, which is a known issue. We need to add some kind of edge detection to the action sheet. (Or rethink it entirely at some point, because it's a super unwieldy component right now, and probably overlaps in functionality with the popup.)

@Joe-5mith
Copy link
Author

Setting overflow-y: hidden on the .menu-bar class and position: relative; left: 50%; on the .action-sheet-container class did not work for me.

The following has worked (written in SASS):

.menu-bar {
    overflow-x: visible;
    .action-sheet-container {
        display: block;
    }
}

@phiychai
Copy link

phiychai commented May 5, 2015

I have tried this but it doesnt work me also. Anyone have any idea what to do?

@Joe-5mith
Copy link
Author

@bbcreatv, did you try using the SASS I wrote out in my previous comment above? That SASS has worked for me so far.

@phiychai
Copy link

phiychai commented May 6, 2015

I actually figured it after. I had to set overflow-x and y visible on my grid-block as well as the menu :)

@lucafabbri
Copy link

Hi,

Sass above works well.
I've figured out that using an icon within the anchor makes toggle trigger twice, so that action sheet open and close immediatelly.

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

No branches or pull requests

4 participants