mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Use offsetWidth instead of scrollWidth
scrollWidth does not work on Chrome with `display: inline` element.
This commit is contained in:
+2
-2
@@ -296,9 +296,9 @@ function checkBoldBroken(terminal) {
|
||||
const el = document.createElement('span');
|
||||
el.innerHTML = 'hello world';
|
||||
terminal.appendChild(el);
|
||||
const w1 = el.scrollWidth;
|
||||
const w1 = el.offsetWidth;
|
||||
el.style.fontWeight = 'bold';
|
||||
const w2 = el.scrollWidth;
|
||||
const w2 = el.offsetWidth;
|
||||
terminal.removeChild(el);
|
||||
return w1 !== w2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user