Description
catalog-modal.js relies on the DOMContentLoaded event for initialization. However, this script is dynamically loaded after the page has already finished loading through _includes/modal.html.
As a result, the DOMContentLoaded callback never executes, preventing the "Read More" initialization logic from running for dynamically loaded modal content.
Expected Behavior
The initialization logic should execute regardless of whether the script is loaded before or after the DOMContentLoaded event.
A possible solution is to use document.readyState and initialize immediately if the document has already loaded.
Screenshots
N/A (JavaScript lifecycle issue)
Environment:
- OS: macOS
- Browser: Chrome
- Version: Latest
- Device: Desktop
Description
catalog-modal.jsrelies on theDOMContentLoadedevent for initialization. However, this script is dynamically loaded after the page has already finished loading through_includes/modal.html.As a result, the
DOMContentLoadedcallback never executes, preventing the "Read More" initialization logic from running for dynamically loaded modal content.Expected Behavior
The initialization logic should execute regardless of whether the script is loaded before or after the
DOMContentLoadedevent.A possible solution is to use
document.readyStateand initialize immediately if the document has already loaded.Screenshots
N/A (JavaScript lifecycle issue)
Environment: