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
7956c744
Unverified
Commit
7956c744
authored
Jan 26, 2019
by
Torkel Ödegaard
Committed by
GitHub
Jan 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15070 from grafana/scrollbar-fixes
Added missing props not being passed to scrollbar component
parents
f3dc5381
27858c02
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.tsx
+22
-8
packages/grafana-ui/src/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap
+2
-2
packages/grafana-ui/src/components/Select/Select.tsx
+1
-1
No files found.
packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.tsx
View file @
7956c744
...
@@ -7,10 +7,10 @@ interface Props {
...
@@ -7,10 +7,10 @@ interface Props {
autoHide
?:
boolean
;
autoHide
?:
boolean
;
autoHideTimeout
?:
number
;
autoHideTimeout
?:
number
;
autoHideDuration
?:
number
;
autoHideDuration
?:
number
;
auto
MaxHeight
?:
string
;
auto
HeightMax
?:
string
;
hideTracksWhenNotNeeded
?:
boolean
;
hideTracksWhenNotNeeded
?:
boolean
;
scrollTop
?:
number
;
scrollTop
?:
number
;
setScrollTop
:
(
value
:
React
.
MouseEvent
<
HTMLElement
>
)
=>
void
;
setScrollTop
:
(
event
:
any
)
=>
void
;
autoHeightMin
?:
number
|
string
;
autoHeightMin
?:
number
|
string
;
}
}
...
@@ -20,13 +20,13 @@ interface Props {
...
@@ -20,13 +20,13 @@ interface Props {
export
class
CustomScrollbar
extends
PureComponent
<
Props
>
{
export
class
CustomScrollbar
extends
PureComponent
<
Props
>
{
static
defaultProps
:
Partial
<
Props
>
=
{
static
defaultProps
:
Partial
<
Props
>
=
{
customClassName
:
'custom-scrollbars'
,
customClassName
:
'custom-scrollbars'
,
autoHide
:
tru
e
,
autoHide
:
fals
e
,
autoHideTimeout
:
200
,
autoHideTimeout
:
200
,
autoHideDuration
:
200
,
autoHideDuration
:
200
,
autoMaxHeight
:
'100%'
,
hideTracksWhenNotNeeded
:
false
,
setScrollTop
:
()
=>
{},
setScrollTop
:
()
=>
{},
autoHeightMin
:
'0'
hideTracksWhenNotNeeded
:
false
,
autoHeightMin
:
'0'
,
autoHeightMax
:
'100%'
,
};
};
private
ref
:
React
.
RefObject
<
Scrollbars
>
;
private
ref
:
React
.
RefObject
<
Scrollbars
>
;
...
@@ -57,16 +57,30 @@ export class CustomScrollbar extends PureComponent<Props> {
...
@@ -57,16 +57,30 @@ export class CustomScrollbar extends PureComponent<Props> {
}
}
render
()
{
render
()
{
const
{
customClassName
,
children
,
autoMaxHeight
}
=
this
.
props
;
const
{
customClassName
,
children
,
autoHeightMax
,
autoHeightMin
,
setScrollTop
,
autoHide
,
autoHideTimeout
,
hideTracksWhenNotNeeded
,
}
=
this
.
props
;
return
(
return
(
<
Scrollbars
<
Scrollbars
ref=
{
this
.
ref
}
ref=
{
this
.
ref
}
className=
{
customClassName
}
className=
{
customClassName
}
onScroll=
{
setScrollTop
}
autoHeight=
{
true
}
autoHeight=
{
true
}
autoHide=
{
autoHide
}
autoHideTimeout=
{
autoHideTimeout
}
hideTracksWhenNotNeeded=
{
hideTracksWhenNotNeeded
}
// These autoHeightMin & autoHeightMax options affect firefox and chrome differently.
// These autoHeightMin & autoHeightMax options affect firefox and chrome differently.
// Before these where set to inhert but that caused problems with cut of legends in firefox
// Before these where set to inhert but that caused problems with cut of legends in firefox
autoHeightMax=
{
autoMaxHeight
}
autoHeightMax=
{
autoHeightMax
}
autoHeightMin=
{
autoHeightMin
}
renderTrackHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"track-horizontal"
/>
}
renderTrackHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"track-horizontal"
/>
}
renderTrackVertical=
{
props
=>
<
div
{
...
props
}
className=
"track-vertical"
/>
}
renderTrackVertical=
{
props
=>
<
div
{
...
props
}
className=
"track-vertical"
/>
}
renderThumbHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"thumb-horizontal"
/>
}
renderThumbHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"thumb-horizontal"
/>
}
...
...
packages/grafana-ui/src/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap
View file @
7956c744
...
@@ -7,7 +7,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
...
@@ -7,7 +7,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
Object {
Object {
"height": "auto",
"height": "auto",
"maxHeight": "100%",
"maxHeight": "100%",
"minHeight":
0
,
"minHeight":
"0"
,
"overflow": "hidden",
"overflow": "hidden",
"position": "relative",
"position": "relative",
"width": "100%",
"width": "100%",
...
@@ -24,7 +24,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
...
@@ -24,7 +24,7 @@ exports[`CustomScrollbar renders correctly 1`] = `
"marginBottom": 0,
"marginBottom": 0,
"marginRight": 0,
"marginRight": 0,
"maxHeight": "calc(100% + 0px)",
"maxHeight": "calc(100% + 0px)",
"minHeight":
0
,
"minHeight":
"calc(0 + 0px)"
,
"overflow": "scroll",
"overflow": "scroll",
"position": "relative",
"position": "relative",
"right": undefined,
"right": undefined,
...
...
packages/grafana-ui/src/components/Select/Select.tsx
View file @
7956c744
...
@@ -61,7 +61,7 @@ interface AsyncProps {
...
@@ -61,7 +61,7 @@ interface AsyncProps {
export
const
MenuList
=
(
props
:
any
)
=>
{
export
const
MenuList
=
(
props
:
any
)
=>
{
return
(
return
(
<
components
.
MenuList
{
...
props
}
>
<
components
.
MenuList
{
...
props
}
>
<
CustomScrollbar
autoHide=
{
false
}
auto
MaxHeight
=
"inherit"
>
{
props
.
children
}
</
CustomScrollbar
>
<
CustomScrollbar
autoHide=
{
false
}
auto
HeightMax
=
"inherit"
>
{
props
.
children
}
</
CustomScrollbar
>
</
components
.
MenuList
>
</
components
.
MenuList
>
);
);
};
};
...
...
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