fix(dees-service-lib-loader): prevent horizontal scrollbar by offsetting xterm WidthCache measurement container

This commit is contained in:
2026-02-01 23:51:53 +00:00
parent eba2a03355
commit 7e2386bcdf
3 changed files with 20 additions and 2 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-catalog',
version: '3.41.4',
version: '3.41.5',
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
}

View File

@@ -193,9 +193,20 @@ export class DeesServiceLibLoader {
const response = await fetch(cssUrl);
const cssText = await response.text();
// Fix for xterm.js WidthCache measurement container causing horizontal scrollbar
// xterm.js creates this on document.body with width: 50000px, top: -50000px
// Moving it off-screen horizontally prevents scrollWidth expansion
const xtermMeasurementFix = `
/* Fix xterm.js WidthCache measurement container causing horizontal scrollbar */
/* xterm creates this on document.body - move it off-screen horizontally too */
body > div[style*="top: -50000px"][style*="width: 50000px"] {
left: -50000px !important;
}
`;
const style = document.createElement('style');
style.id = styleId;
style.textContent = cssText;
style.textContent = cssText + xtermMeasurementFix;
document.head.appendChild(style);
}