Skip to content

Commit

Permalink
Make sure history container is always the latest for scrolling load
Browse files Browse the repository at this point in the history
loadHistoryPage is run on scroll, which might be triggered before htmx fully
refreshes content(e.g. when receiving mainContainerChanged event), at which
time container could be outdated.

This fixes the issue that after ticket/asset queue/catalog is changed on
display page via inline edit, history widget may fetch the same content
endlessly.
  • Loading branch information
sunnavy committed Sep 11, 2024
1 parent c7b84df commit b476a33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion share/html/Elements/ShowHistoryHeader
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ jQuery(function(){
};

var loadHistoryPage = function() {
if (isLoading || container.hasAttribute('data-disable-scroll-loading')) return;
container = document.querySelector('div.history-container');
if (isLoading || !container || container.hasAttribute('data-disable-scroll-loading')) return;

isLoading = true;
showLoadingMessage();
Expand Down

0 comments on commit b476a33

Please sign in to comment.