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

fix: Schedule .modal("hide") for transitioning modals #4173

Merged
merged 7 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions inst/www/shared/shiny.js
Original file line number Diff line number Diff line change
Expand Up @@ -5269,6 +5269,20 @@
}
});

// node_modules/core-js/modules/es.weak-set.constructor.js
var require_es_weak_set_constructor = __commonJS({
"node_modules/core-js/modules/es.weak-set.constructor.js": function() {
"use strict";
var collection = require_collection();
var collectionWeak = require_collection_weak();
collection("WeakSet", function(init2) {
return function WeakSet2() {
return init2(this, arguments.length ? arguments[0] : void 0);
};
}, collectionWeak);
}
});

// node_modules/core-js/internals/array-buffer-basic-detection.js
var require_array_buffer_basic_detection = __commonJS({
"node_modules/core-js/internals/array-buffer-basic-detection.js": function(exports, module) {
Expand Down Expand Up @@ -5659,20 +5673,6 @@
}
});

// node_modules/core-js/modules/es.weak-set.constructor.js
var require_es_weak_set_constructor = __commonJS({
"node_modules/core-js/modules/es.weak-set.constructor.js": function() {
"use strict";
var collection = require_collection();
var collectionWeak = require_collection_weak();
collection("WeakSet", function(init2) {
return function WeakSet2() {
return init2(this, arguments.length ? arguments[0] : void 0);
};
}, collectionWeak);
}
});

// node_modules/core-js/modules/es.array.index-of.js
var $ = require_export();
var uncurryThis = require_function_uncurry_this_clause();
Expand Down Expand Up @@ -20960,6 +20960,11 @@

// srcts/src/shiny/modal.ts
var import_es_array_iterator46 = __toESM(require_es_array_iterator());

// node_modules/core-js/modules/es.weak-set.js
require_es_weak_set_constructor();

// srcts/src/shiny/modal.ts
var import_jquery35 = __toESM(require_jquery());
function _typeof46(obj) {
"@babel/helpers - typeof";
Expand Down Expand Up @@ -21266,6 +21271,7 @@
});
};
}
var modalsInTransition = /* @__PURE__ */ new WeakSet();
function show() {
return _show.apply(this, arguments);
}
Expand All @@ -21291,6 +21297,14 @@
$modal.remove();
}
});
$modal.on("show.bs.modal", function(e4) {
if (e4.target === (0, import_jquery35.default)("#shiny-modal")[0]) {
modalsInTransition.add(e4.target);
}
});
$modal.on("shown.bs.modal", function(e4) {
modalsInTransition.delete(e4.target);
});
}
$modal.on("keydown.shinymodal", function(e4) {
if ((0, import_jquery35.default)("#shiny-modal").data("keyboard") === false)
Expand All @@ -21316,7 +21330,14 @@
var $modal = (0, import_jquery35.default)("#shiny-modal-wrapper");
$modal.off("keydown.shinymodal");
if ($modal.find(".modal").length > 0) {
$modal.find(".modal").modal("hide");
var $bsModal = $modal.find(".modal");
if (modalsInTransition.has($bsModal[0])) {
$bsModal.on("shown.bs.modal", function() {
return $bsModal.modal("hide");
});
} else {
$bsModal.modal("hide");
}
} else {
shinyUnbindAll($modal);
$modal.remove();
Expand Down Expand Up @@ -22632,9 +22653,6 @@
}
});

// node_modules/core-js/modules/es.weak-set.js
require_es_weak_set_constructor();

// srcts/src/shiny/outputProgress.ts
var import_es_regexp_exec15 = __toESM(require_es_regexp_exec());
function _typeof50(obj) {
Expand Down
Loading
Loading