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

hideCurrent option doesn't work #392

Open
nileLivingston opened this issue Oct 9, 2018 · 2 comments
Open

hideCurrent option doesn't work #392

nileLivingston opened this issue Oct 9, 2018 · 2 comments

Comments

@nileLivingston
Copy link

Hello again!

Thanks for the great plugin. I've found an issue with version 3.8.2, specifically with the hideCurrent option. It doesn't work correctly on the official example, so I'm confident this isn't an artifact of my implementation.

I think I've found the culprit, starting on line 1563:

if(self.options.hideCurrent) {
    activeElem.hide().promise().done(function () {
        self.listItems.show();
    });
}

After activeElem is hidden, the Promise returns and all of the listItems (including activeElem) are shown. This renders the hideCurrent option inoperative.

One way to fix this issue is to simply compare each list item against activeElem, and only show the item if they are not equal.

if (self.options.hideCurrent) {
    activeElem.hide().promise().done(function () {
        self.listItems.each(function() {
            if (!$(this).is(activeElem)) {
                $(this).show();
            }
        });
    });
}

Hope this helps!

@vishalp36
Copy link

+1

@afourmeaux
Copy link

afourmeaux commented Sep 1, 2020

Yep, still not working

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