File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ order: 4
1818| className | className for the root component | ` string ` | ` undefined `
1919| disableDefaultStyles | removes basic styling to ease visual customization | ` boolean ` | ` false `
2020| hideTracksWhenNotNeeded | Hide tracks (` visibility: hidden ` ) when content does not overflow container. | ` boolean ` | ` false ` |
21+ | id | The ` id ` to apply to the root element | ` string ` | ` undefined ` |
2122| onScroll | Event handler | ` (e: React.UIEvent<HTMLElement>) => void ` | ` undefined ` |
2223| onScrollFrame | Runs inside the animation frame. Type of ` ScrollValues ` you can check below | ` (values: ScrollValues) => void ` | ` undefined ` |
2324| onScrollStart | Called when scrolling starts | ` () => void ` | ` undefined ` |
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export interface ScrollbarsProps {
1313 classes ?: Partial < StyleClasses > ;
1414 disableDefaultStyles : boolean ;
1515 hideTracksWhenNotNeeded ?: boolean ;
16+ id ?: string ;
1617 onScroll ?: ( e : React . UIEvent < HTMLElement > ) => void ;
1718 onScrollFrame ?: ( values : ScrollValues ) => void ;
1819 onScrollStart ?: ( ) => void ;
Original file line number Diff line number Diff line change @@ -27,6 +27,19 @@ export default function createTests(scrollbarWidth) {
2727 ) ;
2828 } ) ;
2929
30+ it ( 'takes id' , ( done ) => {
31+ render (
32+ < Scrollbars id = "foo" >
33+ < div style = { { width : 200 , height : 200 } } />
34+ </ Scrollbars > ,
35+ node ,
36+ function callback ( ) {
37+ expect ( findDOMNode ( this ) . id ) . toEqual ( 'foo' ) ;
38+ done ( ) ;
39+ } ,
40+ ) ;
41+ } ) ;
42+
3043 it ( 'takes styles' , ( done ) => {
3144 render (
3245 < Scrollbars style = { { width : 100 , height : 100 } } >
You can’t perform that action at this time.
0 commit comments