Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 872559a

Browse files
authoredJul 8, 2024··
Merge pull request #100 from cisagov/cart-2-plus-load-fix
Cart: clear file input before opening, removes need to refresh page t…
2 parents 1e2315d + 72676d1 commit 872559a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎app/static/js/decider.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,10 @@ document.addEventListener('alpine:init', function () {
850850
},
851851

852852
loadFromJson() {
853-
// button -> trigger <input> file selector
854-
document.getElementById('cartFile').click();
853+
// button -> clear & then open <input> file selector
854+
const fileInput = document.getElementById('cartFile');
855+
fileInput.value = "";
856+
fileInput.click();
855857
},
856858

857859
loadFromJsonFileChanged(inputEl) {

‎app/templates/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ <h1 class="modal-title fs-2" id="welcomeModalLabel">Welcome to Decider!</h1>
416416
<script src="/static/js/lib/minisearch-6.1.0/minisearch-6.1.0.min.js"></script>
417417
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-focus-3.12.2.min.js"></script>
418418
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-3.12.2.min.js"></script>
419-
<script src="/static/js/decider.js?cache_bust=24feb07"></script>
419+
<script src="/static/js/decider.js?cache_bust=24jul03"></script>
420420
{% else %}
421421
<script src="/static/js/lib/jquery-3.7.0.slim/jquery-3.7.0.slim.js"></script>
422422
<script src="/static/js/lib/mark.js-9.0.0/jquery.mark.es6.js"></script>
@@ -427,7 +427,7 @@ <h1 class="modal-title fs-2" id="welcomeModalLabel">Welcome to Decider!</h1>
427427
<script src="/static/js/lib/minisearch-6.1.0/minisearch-6.1.0.js"></script>
428428
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-focus-3.12.2.js"></script>
429429
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-3.12.2.js"></script>
430-
<script src="/static/js/decider.js?cache_bust=24feb07"></script>
430+
<script src="/static/js/decider.js?cache_bust=24jul03"></script>
431431
{% endif %}
432432

433433
{{ user_additions.body_bottom() }}

0 commit comments

Comments
 (0)
Please sign in to comment.