terrymun / Fluidbox

Replicating and improving the lightbox module seen on Medium with fluid transitions.
http://terrymun.github.io/Fluidbox/
Other
2.15k stars 166 forks source link

trigger('close.fluidbox') breaks re-opening #189

Closed kspearrin closed 7 years ago

kspearrin commented 7 years ago

Example:

var lightboxSelector = 'a[rel="lightbox"]';

$(lightboxSelector).fluidbox();

$(document).keydown(function (e) {
    if (e.keyCode === 27) {
        $(lightboxSelector).trigger('close.fluidbox');
    }
});

This only seems to happen when manually calling trigger('close.fluidbox'). Clicking the open element to close it doesn't seem to cause the issue.

This is v2.0.0 (latest available on npm).

See real example here: https://help.bitwarden.com/article/groups/

terrymun commented 7 years ago

Which version of Fluidbox are you using? That is a very strange behaviour. It seems like the .fluidbox-open and .fluidbox--closed class modifiers are not being toggled properly during open/closing in your site, but I cannot reproduce that behaviour using the latest release.

kspearrin commented 7 years ago

@terrymun This is v2.0.0 which is the latest available on npm.

terrymun commented 7 years ago

v2.0.5 should not have that issue—that is the latest official release. I will look into why the NPM version is not being kept up-to-date. Can you try loading v2.0.5 and report back to me if this issue is still reproducible?

kspearrin commented 7 years ago

v2.0.5 seems to have fixed it. Can you please let me know when npm is updated?

terrymun commented 7 years ago

Sorry, my bad! It seems like I have been consistently forgetting to publish to NPM for the past 4 public releases. I do apologise for the frustration. v2.0.5 has been published to NPM :) https://www.npmjs.com/package/fluidbox