Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
cd78f0be
Commit
cd78f0be
authored
Mar 05, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed scrollbar not visible due to content being added a bit after mount, fixes #15711
parent
12b6ab2d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletions
+19
-1
packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.tsx
+15
-0
public/app/features/dashboard/containers/DashboardPage.tsx
+1
-0
public/app/features/dashboard/containers/__snapshots__/DashboardPage.test.tsx.snap
+2
-0
public/app/features/dashboard/panel_editor/EditorTabBody.tsx
+1
-1
No files found.
packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.tsx
View file @
cd78f0be
...
...
@@ -15,6 +15,7 @@ interface Props {
scrollTop
?:
number
;
setScrollTop
:
(
event
:
any
)
=>
void
;
autoHeightMin
?:
number
|
string
;
updateAfterMountMs
?:
number
;
}
/**
...
...
@@ -48,6 +49,20 @@ export class CustomScrollbar extends Component<Props> {
componentDidMount
()
{
this
.
updateScroll
();
// this logic is to make scrollbar visible when content is added body after mount
if
(
this
.
props
.
updateAfterMountMs
)
{
setTimeout
(()
=>
this
.
updateAfterMount
(),
this
.
props
.
updateAfterMountMs
);
}
}
updateAfterMount
()
{
if
(
this
.
ref
&&
this
.
ref
.
current
)
{
const
scrollbar
=
this
.
ref
.
current
as
any
;
if
(
scrollbar
.
update
)
{
scrollbar
.
update
();
}
}
}
componentDidUpdate
()
{
...
...
public/app/features/dashboard/containers/DashboardPage.tsx
View file @
cd78f0be
...
...
@@ -272,6 +272,7 @@ export class DashboardPage extends PureComponent<Props, State> {
autoHeightMin=
{
'100%'
}
setScrollTop=
{
this
.
setScrollTop
}
scrollTop=
{
scrollTop
}
updateAfterMountMs=
{
500
}
className=
"custom-scrollbar--page"
>
{
editview
&&
<
DashboardSettings
dashboard=
{
dashboard
}
/>
}
...
...
public/app/features/dashboard/containers/__snapshots__/DashboardPage.test.tsx.snap
View file @
cd78f0be
...
...
@@ -113,6 +113,7 @@ exports[`DashboardPage Dashboard init completed Should render dashboard grid 1`
hideTracksWhenNotNeeded={false}
scrollTop={0}
setScrollTop={[Function]}
updateAfterMountMs={500}
>
<div
className="dashboard-container"
...
...
@@ -349,6 +350,7 @@ exports[`DashboardPage When dashboard has editview url state should render setti
hideTracksWhenNotNeeded={false}
scrollTop={0}
setScrollTop={[Function]}
updateAfterMountMs={500}
>
<DashboardSettings
dashboard={
...
...
public/app/features/dashboard/panel_editor/EditorTabBody.tsx
View file @
cd78f0be
...
...
@@ -118,7 +118,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
{
toolbarItems
.
map
(
item
=>
this
.
renderButton
(
item
))
}
</
div
>
<
div
className=
"panel-editor__scroll"
>
<
CustomScrollbar
autoHide=
{
false
}
scrollTop=
{
scrollTop
}
setScrollTop=
{
setScrollTop
}
>
<
CustomScrollbar
autoHide=
{
false
}
scrollTop=
{
scrollTop
}
setScrollTop=
{
setScrollTop
}
updateAfterMountMs=
{
300
}
>
<
div
className=
"panel-editor__content"
>
<
FadeIn
in=
{
isOpen
}
duration=
{
200
}
unmountOnExit=
{
true
}
>
{
openView
&&
this
.
renderOpenView
(
openView
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment