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

nav-dropdown doesn't work with nav-right #2

Closed
sushiljainam opened this issue Oct 11, 2016 · 14 comments
Closed

nav-dropdown doesn't work with nav-right #2

sushiljainam opened this issue Oct 11, 2016 · 14 comments
Assignees

Comments

@sushiljainam
Copy link

inside nav-fixed:
I wanted to show a nav-dropdown on the right side.
but hovering on it does not display -- list items.

actually, they are displayed, but behind..
Solve it please.

@Borderliner
Copy link
Owner

Thanks for reporting. I'll try to fix that asap, and will release a hotfix when it's ready.

@Borderliner
Copy link
Owner

Fixed the issue, release v1.2.4 as a hotfix. Will be available on CDNJS in a couple of minutes.
https://github.com/Borderliner/Meshki/releases/tag/v1.2.4

@sushiljainam
Copy link
Author

sushiljainam commented Oct 11, 2016

Oh! It started working. Thanks for quick response.
BUT
still not properly..
check this code:
check the top-right 'links'

@sushiljainam
Copy link
Author

sushiljainam commented Oct 11, 2016

@Borderliner
tell me If you need a screenshot

@Borderliner
Copy link
Owner

Borderliner commented Oct 11, 2016

@sushiljainam You mean when the dropdown goes out of the screen? Sending a screenshot would be great.
As a workaround, you can set the right property of the nav-dropdown-content to 0 manually, so it doesn't go out of the screen. But I'll try to come up with a fix as soon as possible.

@sushiljainam
Copy link
Author

yes, you got it. ".. dropdown goes out of the screen..".
I will try to make that solution..

inform me, If it can be fixed at your end. thanks!

@Borderliner
Copy link
Owner

Borderliner commented Oct 11, 2016

@sushiljainam Please verify that the below code fixes the issue. Put it somewhere in your custom css file:

.nav ul li.nav-right.nav-dropdown .nav-dropdown-content {
  right: 0;
}

.nav ul li.nav-right.nav-dropdown ~ .nav-dropdown .nav-dropdown-content {
  right: auto;
}

It works on the jsfiddle you gave, verify it in your own project. What it really does, is that it sets the right property of the last dropdown (first in html) to 0. Tell me if it works properly, so that I can release another hotfix. Thanks.

@Borderliner Borderliner self-assigned this Oct 11, 2016
@sushiljainam
Copy link
Author

@Borderliner Yes, It's working fine. :) thanks.

@sushiljainam
Copy link
Author

sushiljainam commented Oct 12, 2016

It's fine for my case.

but check this:
others can get 'improper positioned display' in such use-cases..

<div class="nav fixed">
     <ul>
        <li><a href="logs">logs</a></li>
        <li><a href="resume">resume</a></li>
        <li class="nav-right"><a href="#">configuration/settings</a></li>
        <li class="nav-right nav-dropdown hide-on-mobile">
          <a href="javascript:void(0)" class="nav-dropdown-button">links</a>
          <div class="nav-dropdown-content">
            <a href="#">twitter</a>
            <a href="#">tumbler</a>
            <a href="#">wordpress</a>
            <a href="#">gmail</a>
            <a href="#">mail</a>
          </div>
        </li>
      </ul>
  </div>

where: last nav menu is having more characters "configuration/settings" in this example.
run it somewhere. Hope, it helps.

@Borderliner
Copy link
Owner

I know, there's nothing I can do logically. CSS is not that smart to detect which elements are out of the screen. In such cases, one needs to set the right property manually. I will release a hotfix soon. Thank you for reporting the issue.

@sushiljainam
Copy link
Author

sushiljainam commented Oct 13, 2016

yeah.. we can close it now.
by the way.. why did you reopen this?

or you closed it by mistake?

@Borderliner
Copy link
Owner

The actual fix would be to use JavaScript to calculate the width and position of dropdown-content. But since Meshki tries to be as simple as possible while being useful and stable, I'm not gonna add more JavaScript code, unless it's necessary. This CSS workaround will be enough for most cases. I reopened this issue because I thought JS fix could be another option, but I changed my mind. I will close this issue after the release.

@sushiljainam
Copy link
Author

sushiljainam commented Oct 13, 2016

yes! don't add that JS. css is enough for 'most cases'.

@Borderliner
Copy link
Owner

Borderliner commented Oct 13, 2016

Fix released: https://github.com/Borderliner/Meshki/releases/tag/v1.2.5
Website updated: http://meshki.borderliner.ir/
It may take up to 1 hour for CDNs to update themselves. Please be patient.
Thanks for your contribution.
Closing the issue.

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

No branches or pull requests

2 participants