trigger('close.fluidbox') breaks re-opening
Closed this issue · 5 comments
Example:
var lightboxSelector = 'a[rel="lightbox"]';
$(lightboxSelector).fluidbox();
$(document).keydown(function (e) {
if (e.keyCode === 27) {
$(lightboxSelector).trigger('close.fluidbox');
}
});
- Click the element to open the fluidbox.
- Press
esc
to close the fluidbox. - Click the same element again, observe that it does not respond.
- Click the same element again (second time), observe that it now opens as expected.
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/
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.
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?
v2.0.5 seems to have fixed it. Can you please let me know when npm is updated?
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