- 🐛 Fixed card scripts executing before DOM is parsed - Fabien egg O'Carroll
View the changelogs for full details:
- Ghost - v4.27.0...v4.27.1
- Admin - TryGhost/Admin@v4.27.0...v4.27.1
Tag Name: v4.27.1
Release Date: 12/8/2021
GhostOpen-source publishing platform specifically designed for professional bloggers and publications. Focuses on clean, minimalist writing and publishing experience.
Ghost v4.27.1 is a minor bug fix release that addresses an issue with card scripts executing before the DOM is fully parsed. This fix ensures that toggle cards and other interactive elements work correctly by changing script loading from async to defer attribute, allowing scripts to safely access DOM elements after parsing is complete.
async to defer attribute for better DOM interactionNo migration steps are required for this update. The fix is applied automatically when you update to Ghost v4.27.1.
This update is recommended for all Ghost users, especially those who use toggle cards or other interactive card elements in their content. The update ensures these elements function correctly by fixing script execution timing.
To upgrade:
Fixed an issue where card scripts were executing before the DOM was fully parsed, causing toggle cards and potentially other interactive elements to malfunction. The problem occurred because scripts were using the async attribute, which downloads scripts in parallel with DOM parsing but executes them immediately upon download completion, regardless of whether DOM parsing has finished.
The fix changes these scripts to use the defer attribute instead, which still allows parallel downloading but ensures scripts only execute after the DOM parsing is complete. This ensures that all DOM elements are available when the scripts run, resolving the issues with toggle cards not working properly.
No new features were introduced in this release. This is a bug fix release focused on improving the reliability of existing functionality.
No security fixes were included in this release.
No specific performance improvements were included in this release. The primary focus was on fixing the script execution timing issue.
This release addresses a specific bug that affected the functionality of toggle cards and potentially other interactive elements in Ghost content. By changing how scripts are loaded (from async to defer), the update ensures that scripts only execute after the DOM is fully parsed, allowing them to safely access all DOM elements.
While this is a minor fix, it significantly improves the reliability of interactive content elements, providing a better experience for both content creators and site visitors. Content creators will no longer experience unexpected behavior when using toggle cards, and site visitors will benefit from properly functioning interactive elements.
The change is fully backward compatible and requires no action from users beyond updating to the latest version.
View the changelogs for full details: