Skip to content

Commit 578b0a3

Browse files
authored
Add contain strict for absolutely positioned elements which specify all (#506)
coordinates and dimensions (top/left/width/height or top/left/bottom/right)
1 parent abfd491 commit 578b0a3

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

packages/widgets/src/accordionlayout.ts

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ namespace Private {
241241
): HTMLElement {
242242
const title = renderer.createSectionTitle(data);
243243
title.style.position = 'absolute';
244+
title.style.contain = 'strict';
244245
title.setAttribute('aria-label', `${data.label} Section`);
245246
title.setAttribute('aria-expanded', expanded ? 'true' : 'false');
246247
title.setAttribute('aria-controls', data.owner.id);

packages/widgets/src/docklayout.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ export class DockLayout extends Layout {
11191119
// Initialize the handle layout behavior.
11201120
let style = handle.style;
11211121
style.position = 'absolute';
1122+
style.contain = 'strict';
11221123
style.top = '0';
11231124
style.left = '0';
11241125
style.width = '0';

packages/widgets/src/dockpanel.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@ export namespace DockPanel {
12811281
this.node.classList.add('lm-DockPanel-overlay');
12821282
this.node.classList.add('lm-mod-hidden');
12831283
this.node.style.position = 'absolute';
1284+
this.node.style.contain = 'strict';
12841285
}
12851286

12861287
/**

packages/widgets/src/layout.ts

+3
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,12 @@ export class LayoutItem implements IDisposable {
619619
*
620620
* #### Notes
621621
* The widget will be set to absolute positioning.
622+
* The widget will use strict CSS containment.
622623
*/
623624
constructor(widget: Widget) {
624625
this.widget = widget;
625626
this.widget.node.style.position = 'absolute';
627+
this.widget.node.style.contain = 'strict';
626628
}
627629

628630
/**
@@ -647,6 +649,7 @@ export class LayoutItem implements IDisposable {
647649
style.left = '';
648650
style.width = '';
649651
style.height = '';
652+
style.contain = '';
650653
}
651654

652655
/**

packages/widgets/src/splitlayout.ts

+1
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ namespace Private {
829829
): HTMLDivElement {
830830
let handle = renderer.createHandle();
831831
handle.style.position = 'absolute';
832+
handle.style.contain = 'strict';
832833
return handle;
833834
}
834835

0 commit comments

Comments
 (0)