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

remove highlight for clicked item in navbar #28

Closed
veswill3 opened this issue Oct 11, 2015 · 8 comments
Closed

remove highlight for clicked item in navbar #28

veswill3 opened this issue Oct 11, 2015 · 8 comments
Milestone

Comments

@veswill3
Copy link

Cool theme. While I was browsing around the live demo I noticed that the navbar will highlight an option when it should not.
To reproduce, click on one of the options to scroll to that section, and then manually scroll back up some. Instead of the currently visible section being the only highlighted option, both stay highlighted.

@le4ker
Copy link
Owner

le4ker commented Oct 11, 2015

If I'm not wrong, this is the original's grayscale behavior:

http://ironsummitmedia.github.io/startbootstrap-grayscale/

When you scroll through the sections, the navbar highlights the section you are currently viewing.

@veswill3
Copy link
Author

It does that as expected but you can end up in a situation where 2 are highlighted at the same time by clicking on one and then scrolling to a different one. The only you clicked will stay lighter and the one you scroll to will activate and highlight as well. If you just grabbed this from somewhere else it may not be your mistake.

@le4ker
Copy link
Owner

le4ker commented Oct 11, 2015

Yes, the repo that I forked was a mashup of grayscale and agency theme's.

I see what you mean now, I think grayscale theme has a fix for this. I will give it a try to integrate it :)

Thanks!

@le4ker
Copy link
Owner

le4ker commented Oct 11, 2015

I was able to repro it on http://panossakkos.github.io/personal-jekyll-theme/ and not in http://ironsummitmedia.github.io/startbootstrap-grayscale.

I will have a look at the grayscale css and fix it. Thanks for reporting it! 👍

@joariasl
Copy link
Collaborator

This occur because in the line grayscale.scss:115 the background highlight including to :focus pseudo-class. It is when the object is selected, if you unselect this item this remove the background.
An possible solution is replace this sentence for:

                &:hover,
                &.active {
                    outline: none;
                    background-color: rgba($light, 0.3);
                }
                &:focus {
                    outline: none;
                    background-color: inherit;
                }

@joariasl
Copy link
Collaborator

Other option (Perhaps the best, since it is due to this behavior) is add the line:

$anchor.blur();

in the file grayscale.js after to line 19.

@joariasl
Copy link
Collaborator

In grayscale theme have removed the :focus style. The problem is that this method not indicate the selected item with tab navigation, because :focus selection not have style.
I applied a fix using javascript for focus out after the transition scrolling is ended.

@le4ker le4ker closed this as completed in cc41274 Oct 16, 2015
le4ker pushed a commit that referenced this issue Oct 16, 2015
@veswill3
Copy link
Author

Awesome. Thanks @PanosSakkos and @joariasl

@le4ker le4ker added this to the Version 4.0.0 milestone Nov 14, 2015
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

3 participants