Skip to content

Commit 55cc124

Browse files
authored
shows h scroll only if needed (#28491)
1 parent d40187b commit 55cc124

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

editor/css/main.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ textarea, input { outline: none; } /* osx */
101101
text-transform: uppercase;
102102
}
103103

104-
.TabbedPanel .Tabs .Tab:last-child {
105-
margin-right: 22px;
106-
}
107-
108104
.TabbedPanel .Panels {
109105
position: absolute;
110106
top: 40px;

editor/js/Sidebar.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ function Sidebar( editor ) {
1212
const container = new UITabbedPanel();
1313
container.setId( 'sidebar' );
1414

15+
const sidebarProperties = new SidebarProperties( editor );
16+
1517
const scene = new UISpan().add(
1618
new SidebarScene( editor ),
17-
new SidebarProperties( editor )
19+
sidebarProperties
1820
);
1921
const project = new SidebarProject( editor );
2022
const settings = new SidebarSettings( editor );
@@ -24,6 +26,14 @@ function Sidebar( editor ) {
2426
container.addTab( 'settings', strings.getKey( 'sidebar/settings' ), settings );
2527
container.select( 'scene' );
2628

29+
const sidebarPropertiesResizeObserver = new ResizeObserver( function () {
30+
31+
sidebarProperties.tabsDiv.setWidth( getComputedStyle( container.dom ).width );
32+
33+
} );
34+
35+
sidebarPropertiesResizeObserver.observe( container.tabsDiv.dom );
36+
2737
return container;
2838

2939
}

0 commit comments

Comments
 (0)