Skip to content

Commit c8f65a3

Browse files
committed
Safely remove container
1 parent 0fb3f13 commit c8f65a3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

app/javascript/controllers/content_loader_controller.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ export default class extends Controller {
3939
}
4040
}
4141
} else {
42-
// Remove result-get container (no fulfillment links)
43-
parentElement.remove()
42+
// Remove only this loader element
43+
this.element.remove();
44+
// Remove result-get container if it's now empty (no fulfillment links and no other content)
45+
if (!parentElement.textContent.trim()) {
46+
parentElement.remove();
47+
}
4448
}
4549
})
4650
}

0 commit comments

Comments
 (0)