camicroscope / caMicroscope

Digital pathology image viewer with support for human/machine generated annotations and markups.
BSD 3-Clause "New" or "Revised" License
255 stars 295 forks source link

fixes #1009 : table duplication issue when screen size less than 800px #1040

Closed rahulptl165 closed 1 week ago

rahulptl165 commented 1 week ago

Summary

This pull request addresses an issue where the .stacktable components (stacktable.small-only and stacktable.large-only) were being activated simultaneously on screen sizes below 800px, causing table duplication. Additionally, it ensures that the stacktable() function is called only once after all table content has been fully updated to avoid redundancy or conflicts.

Motivation

The issue arises from calling the stacktable() function multiple times when the table content changes (e.g., when pagination is applied, or the number of table entries is updated). This results in a table duplication issue when both the .stacktable.small-only and .stacktable.large-onlyclasses are triggered at the same time on smaller screens. The goal is to ensure proper handling of table initialization and avoid unnecessary re-initializations.

Testing

Verified that the table displays correctly on both small and large screen sizes, without duplication. Tested across various screen sizes to ensure the appropriate classes (stacktable.small-only and stacktable.large-only) are applied without overlap.

Screenshot

Screenshot 2024-11-14 180418

rahulptl165 commented 1 week ago

Thanks! Glad the fix and docs were helpful. Noted on the develop branch—I'll keep that in mind for next time!