mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Markdown preview: filter hidden elements from scroll sync (fix #281247)
This commit is contained in:
@@ -20,7 +20,21 @@ export class CodeLineElement {
|
||||
}
|
||||
|
||||
get isVisible(): boolean {
|
||||
return !this._detailParentElements.some(x => !x.open);
|
||||
if (this._detailParentElements.some(x => !x.open)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const style = window.getComputedStyle(this.element);
|
||||
if (style.display === 'none' || style.visibility === 'hidden') {
|
||||
return false;
|
||||
}
|
||||
|
||||
const bounds = this.element.getBoundingClientRect();
|
||||
if (bounds.height === 0 && bounds.width === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user