Skip to content

Commit 4c9e4ae

Browse files
authored
Keep the sidebar toggle button visible regardless of the selected tab. (#5522)
Small fix for the following issue: 1. Open the profiler UI on a small screen. 2. Select the call tree tab (which has a sidebar toggle button), and close the sidebar if its open. 3. Scroll the tab bar to the right so that you can see the Network tab. 4. Select the Marker Chart tab. Before this fix, step 4 would remove the sidebar button and make the tapped tab change positions, causing an odd visual jump.
2 parents 35c066e + 87c3799 commit 4c9e4ae

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/components/app/Details.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -86,32 +86,32 @@ class ProfileViewerImpl extends PureComponent<Props> {
8686
visibleTabs={visibleTabs}
8787
onSelectTab={this._onSelectTab}
8888
/>
89-
{hasSidebar ? (
90-
<Localized
91-
id={
92-
isSidebarOpen
93-
? 'Details--close-sidebar-button'
94-
: 'Details--open-sidebar-button'
95-
}
96-
attrs={{ title: true }}
97-
vars={{ isSidebarOpen: isSidebarOpen }}
98-
>
99-
<button
100-
className={classNames(
101-
'sidebar-open-close-button',
102-
'photon-button',
103-
'photon-button-ghost',
104-
{
105-
'sidebar-open-close-button-isopen': isSidebarOpen,
106-
'sidebar-open-close-button-isclosed': !isSidebarOpen,
107-
}
108-
)}
109-
title={isSidebarOpen ? 'Close the sidebar' : 'Open the sidebar'}
110-
type="button"
111-
onClick={this._onClickSidebarButton}
112-
/>
113-
</Localized>
114-
) : null}
89+
90+
<Localized
91+
id={
92+
isSidebarOpen
93+
? 'Details--close-sidebar-button'
94+
: 'Details--open-sidebar-button'
95+
}
96+
attrs={{ title: true }}
97+
vars={{ isSidebarOpen: isSidebarOpen }}
98+
>
99+
<button
100+
className={classNames(
101+
'sidebar-open-close-button',
102+
'photon-button',
103+
'photon-button-ghost',
104+
{
105+
'sidebar-open-close-button-isopen': isSidebarOpen,
106+
'sidebar-open-close-button-isclosed': !isSidebarOpen,
107+
}
108+
)}
109+
title={isSidebarOpen ? 'Close the sidebar' : 'Open the sidebar'}
110+
type="button"
111+
disabled={!hasSidebar}
112+
onClick={this._onClickSidebarButton}
113+
/>
114+
</Localized>
115115
</div>
116116
<Localized
117117
id="Details--error-boundary-message"

0 commit comments

Comments
 (0)