Skip to content

Commit 7fa885b

Browse files
committed
Re-init visibility elements after a component gets updated.
1 parent a06e94a commit 7fa885b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

django_unicorn/static/unicorn/js/component.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ export class Component {
167167
refreshEventListeners() {
168168
this.actionEvents = {};
169169
this.modelEls = [];
170+
this.loadingEls = [];
171+
this.visibilityEls = [];
170172

171173
try {
172174
this.walker(

django_unicorn/static/unicorn/js/messageSender.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ export function send(component, callback) {
223223
// Reset all event listeners
224224
component.refreshEventListeners();
225225

226+
// Check for visibility elements
227+
component.initVisibility();
228+
226229
// Re-add unicorn validation messages from errors
227230
component.modelEls.forEach((element) => {
228231
Object.keys(component.errors).forEach((modelName) => {

0 commit comments

Comments
 (0)