@@ -22,12 +22,15 @@ export default class SandboxBlock extends React.Component {
2222 this . handleScrollLeftClick = this . handleScrollLeftClick . bind ( this ) ;
2323 this . handleScrollRightClick = this . handleScrollRightClick . bind ( this ) ;
2424 this . toggleRtl = this . toggleRtl . bind ( this ) ;
25+ this . toggleNativeScrollbarClick = this . toggleNativeScrollbarClick . bind ( this ) ;
2526
2627 this . state = {
2728 noScroll : false ,
2829 noScrollY : false ,
2930 noScrollX : false ,
3031
32+ nativeScrollbar : false ,
33+
3134 rtl : false ,
3235
3336 permanentTracks : false ,
@@ -43,7 +46,6 @@ export default class SandboxBlock extends React.Component {
4346
4447 toggleNoScroll ( ) {
4548 this . setState ( {
46- ...this . state ,
4749 noScroll : ! this . state . noScroll ,
4850 noScrollY : ! this . state . noScroll ,
4951 noScrollX : ! this . state . noScroll ,
@@ -52,7 +54,6 @@ export default class SandboxBlock extends React.Component {
5254
5355 toggleNoScrollY ( ) {
5456 this . setState ( {
55- ...this . state ,
5657 noScroll : ( this . state . noScroll ? true : this . state . noScrollX ) && ! this . state . noScrollY ,
5758 noScrollY : ! this . state . noScrollY ,
5859 noScrollX : this . state . noScroll ? true : this . state . noScrollX ,
@@ -61,7 +62,6 @@ export default class SandboxBlock extends React.Component {
6162
6263 toggleNoScrollX ( ) {
6364 this . setState ( {
64- ...this . state ,
6565 noScroll : ! this . state . noScrollX && ( this . state . noScroll ? true : this . state . noScrollY ) ,
6666 noScrollX : ! this . state . noScrollX ,
6767 noScrollY : this . state . noScroll ? true : this . state . noScrollY ,
@@ -70,7 +70,6 @@ export default class SandboxBlock extends React.Component {
7070
7171 togglePermanentTracks ( ) {
7272 this . setState ( {
73- ...this . state ,
7473 permanentTracks : ! this . state . permanentTracks ,
7574 permanentTrackY : ! this . state . permanentTracks ,
7675 permanentTrackX : ! this . state . permanentTracks ,
@@ -79,7 +78,6 @@ export default class SandboxBlock extends React.Component {
7978
8079 togglePermanentTrackY ( ) {
8180 this . setState ( {
82- ...this . state ,
8381 permanentTracks :
8482 ( this . state . permanentTracks ? true : this . state . permanentTrackX ) && ! this . state . permanentTrackY ,
8583 permanentTrackY : ! this . state . permanentTrackY ,
@@ -89,7 +87,6 @@ export default class SandboxBlock extends React.Component {
8987
9088 togglePermanentTrackX ( ) {
9189 this . setState ( {
92- ...this . state ,
9390 permanentTracks :
9491 ! this . state . permanentTrackX && ( this . state . permanentTracks ? true : this . state . permanentTrackY ) ,
9592 permanentTrackX : ! this . state . permanentTrackX ,
@@ -99,21 +96,24 @@ export default class SandboxBlock extends React.Component {
9996
10097 toggleRtl ( ) {
10198 this . setState ( {
102- ...this . state ,
10399 rtl : ! this . state . rtl ,
104100 } ) ;
105101 }
106102
103+ toggleNativeScrollbarClick ( ) {
104+ this . setState ( {
105+ nativeScrollbar : ! this . state . nativeScrollbar ,
106+ } ) ;
107+ }
108+
107109 handleAddParagraphClick ( ) {
108110 this . setState ( {
109- ...this . state ,
110111 paragraphsCount : this . state . paragraphsCount + 1 ,
111112 } ) ;
112113 }
113114
114115 handleRemoveParagraphClick ( ) {
115116 this . setState ( {
116- ...this . state ,
117117 paragraphsCount : Math . max ( 0 , this . state . paragraphsCount - 1 ) ,
118118 } ) ;
119119 }
@@ -140,12 +140,25 @@ export default class SandboxBlock extends React.Component {
140140 }
141141
142142 render ( ) {
143- const { noScroll, noScrollY, noScrollX, permanentTracks, permanentTrackY, permanentTrackX, rtl} = this . state ;
143+ const {
144+ noScroll,
145+ noScrollY,
146+ noScrollX,
147+ permanentTracks,
148+ permanentTrackY,
149+ permanentTrackX,
150+ rtl,
151+ nativeScrollbar,
152+ } = this . state ;
144153
145154 return (
146155 < div className = "block" id = "SandboxBlock" >
147156 < div className = "title" > Sandbox</ div >
148157 < div className = "description" >
158+ < div className = "button" key = "nativeScrollbar" onClick = { this . toggleNativeScrollbarClick } >
159+ { nativeScrollbar ? "Custom scrollbars" : "Native scrollbars" }
160+ </ div >
161+ < br />
149162 < div className = "button" key = "noScroll" onClick = { this . toggleNoScroll } >
150163 { noScroll ? "Enable scroll" : "Disable scroll" }
151164 </ div >
@@ -196,6 +209,7 @@ export default class SandboxBlock extends React.Component {
196209 </ div >
197210 < div className = "content" style = { { height : 280 } } >
198211 < Scrollbar
212+ nativeScrollbars = { nativeScrollbar }
199213 defaultStyles = { false }
200214 ref = { ref => {
201215 this . scrollbar = ref ;
0 commit comments