Skip to content

Commit

Permalink
fix(panel): fix panel close routine if it was closed immediately
Browse files Browse the repository at this point in the history
fixes #4108
  • Loading branch information
nolimits4web committed Dec 16, 2022
1 parent ddf8b36 commit 1ceaafc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/components/panel/panel-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ class Panel extends Framework7Class {

onOpen(modifyHtmlClasses = true) {
const panel = this;
// eslint-disable-next-line
panel._openTimeStamp = new Date().getTime();
const app = panel.app;

panel.opened = true;
Expand Down Expand Up @@ -472,7 +474,6 @@ class Panel extends Framework7Class {

close(animate = true) {
const panel = this;

const { effect, $el, $backdropEl, opened, $containerEl } = panel;
if (!opened || $el.hasClass('panel-in-breakpoint') || !$el.hasClass('panel-in')) return panel;

Expand All @@ -486,6 +487,12 @@ class Panel extends Framework7Class {
$viewEl.add($containerEl.children('.page-content, .tabs'));
}
const transitionEndTarget = effect === 'reveal' ? $viewEl : $el;
// eslint-disable-next-line
const openTimeDiff = new Date().getTime() - panel._openTimeStamp;
if (openTimeDiff < 16) {
// eslint-disable-next-line
animate = false;
}

function transitionEnd() {
if ($el.hasClass('panel-out')) {
Expand Down

0 comments on commit 1ceaafc

Please sign in to comment.