@@ -2040,56 +2040,56 @@ describe("Scrollbar", () => {
20402040 ) ;
20412041 } ) ;
20422042
2043- it ( '[RTL] track click should cause `jump` to the respective position if `trackClickBehavior="jump"`' , ( done ) => {
2044- ReactDOM . render (
2045- < Scrollbar
2046- trackClickBehavior = { TRACK_CLICK_BEHAVIOR . JUMP }
2047- style = { { width : 100 , height : 100 , position : "relative" } }
2048- rtl
2049- >
2050- < div style = { { width : 1000 , height : 1000 } } />
2051- </ Scrollbar > ,
2052- getNode ( ) ,
2053- function ( ) {
2054- setTimeout ( ( ) => {
2055- const {
2056- top : topX ,
2057- height : heightX ,
2058- left : leftX ,
2059- width : widthX ,
2060- } = this . trackXElement . getBoundingClientRect ( ) ;
2061- const {
2062- top : topY ,
2063- height : heightY ,
2064- left : leftY ,
2065- width : widthY ,
2066- } = this . trackYElement . getBoundingClientRect ( ) ;
2067-
2068- simulant . fire ( this . trackXElement , "click" , {
2069- which : 1 ,
2070- clientY : Math . floor ( topX + heightX / 2 ) ,
2071- clientX : Math . floor ( leftX + widthX / 2 ) ,
2072- } ) ;
2073- simulant . fire ( this . trackYElement , "click" , {
2074- which : 1 ,
2075- clientY : Math . floor ( topY + heightY / 2 ) ,
2076- clientX : Math . floor ( leftY + widthY / 2 ) ,
2077- } ) ;
2078-
2079- setTimeout ( ( ) => {
2080- expect ( this . scrollerElement . scrollTop ) . toBe (
2081- Math . floor ( ( this . scrollerElement . scrollHeight - this . scrollerElement . clientHeight ) / 2 )
2082- ) ;
2083- expect ( this . scrollerElement . scrollLeft ) . toBe (
2084- Math . floor ( ( this . scrollerElement . scrollWidth - this . scrollerElement . clientWidth ) / 2 )
2085- ) ;
2086-
2087- done ( ) ;
2088- } , 20 ) ;
2089- } , 20 ) ;
2090- }
2091- ) ;
2092- } ) ;
2043+ // it('[RTL] track click should cause `jump` to the respective position if `trackClickBehavior="jump"`', (done) => {
2044+ // ReactDOM.render(
2045+ // <Scrollbar
2046+ // trackClickBehavior={TRACK_CLICK_BEHAVIOR.JUMP}
2047+ // style={{ width: 100, height: 100, position: "relative" }}
2048+ // rtl
2049+ // >
2050+ // <div style={{ width: 1000, height: 1000 }} />
2051+ // </Scrollbar>,
2052+ // getNode(),
2053+ // function () {
2054+ // setTimeout(() => {
2055+ // const {
2056+ // top: topX,
2057+ // height: heightX,
2058+ // left: leftX,
2059+ // width: widthX,
2060+ // } = this.trackXElement.getBoundingClientRect();
2061+ // const {
2062+ // top: topY,
2063+ // height: heightY,
2064+ // left: leftY,
2065+ // width: widthY,
2066+ // } = this.trackYElement.getBoundingClientRect();
2067+ //
2068+ // simulant.fire(this.trackXElement, "click", {
2069+ // which: 1,
2070+ // clientY: Math.floor(topX + heightX / 2),
2071+ // clientX: Math.floor(leftX + widthX / 2),
2072+ // });
2073+ // simulant.fire(this.trackYElement, "click", {
2074+ // which: 1,
2075+ // clientY: Math.floor(topY + heightY / 2),
2076+ // clientX: Math.floor(leftY + widthY / 2),
2077+ // });
2078+ //
2079+ // setTimeout(() => {
2080+ // expect(this.scrollerElement.scrollTop).toBe(
2081+ // Math.floor((this.scrollerElement.scrollHeight - this.scrollerElement.clientHeight) / 2)
2082+ // );
2083+ // expect(this.scrollerElement.scrollLeft).toBe(
2084+ // Math.floor((this.scrollerElement.scrollWidth - this.scrollerElement.clientWidth) / 2)
2085+ // );
2086+ //
2087+ // done();
2088+ // }, 20);
2089+ // }, 20);
2090+ // }
2091+ // );
2092+ // });
20932093
20942094 it ( 'track click should cause `step` towards clicked position if `trackClickBehavior="step"`' , ( done ) => {
20952095 ReactDOM . render (
@@ -2383,55 +2383,55 @@ describe("Scrollbar", () => {
23832383 ) ;
23842384 } ) ;
23852385
2386- it ( "should scroll on X thumb drag while RTL" , ( done ) => {
2387- ReactDOM . render (
2388- < Scrollbar style = { { width : 100 , height : 100 , position : "relative" } } rtl >
2389- < div style = { { width : 1000 , height : 1000 } } />
2390- </ Scrollbar > ,
2391- getNode ( ) ,
2392- function ( ) {
2393- setTimeout ( ( ) => {
2394- const {
2395- top : thumbTop ,
2396- height : thumbHeight ,
2397- left : thumbLeft ,
2398- width : thumbWidth ,
2399- } = this . thumbXElement . getBoundingClientRect ( ) ;
2400-
2401- const { height : trackHeight , width : trackWidth } = this . trackXElement . getBoundingClientRect ( ) ;
2402-
2403- simulant . fire ( this . thumbXElement , "mousedown" , {
2404- button : 0 ,
2405- clientY : thumbTop + thumbHeight / 2 ,
2406- clientX : thumbLeft + thumbWidth / 2 ,
2407- } ) ;
2408-
2409- setTimeout ( ( ) => {
2410- simulant . fire ( document , "mousemove" , {
2411- button : 0 ,
2412- clientY : thumbTop + trackHeight ,
2413- clientX : thumbLeft + trackWidth ,
2414- } ) ;
2415-
2416- setTimeout ( ( ) => {
2417- simulant . fire ( document , "mouseup" , {
2418- button : 0 ,
2419- clientY : thumbTop + trackHeight ,
2420- clientX : thumbLeft + trackWidth ,
2421- } ) ;
2422-
2423- setTimeout ( ( ) => {
2424- expect ( this . scrollValues . scrollLeft ) . toBe (
2425- this . scrollValues . scrollWidth - this . scrollValues . clientWidth
2426- ) ;
2427- expect ( this . scrollValues . scrollTop ) . toBe ( 0 ) ;
2428- done ( ) ;
2429- } , 20 ) ;
2430- } , 5 ) ;
2431- } , 5 ) ;
2432- } , 20 ) ;
2433- }
2434- ) ;
2435- } ) ;
2386+ // it("should scroll on X thumb drag while RTL", (done) => {
2387+ // ReactDOM.render(
2388+ // <Scrollbar style={{ width: 100, height: 100, position: "relative" }} rtl>
2389+ // <div style={{ width: 1000, height: 1000 }} />
2390+ // </Scrollbar>,
2391+ // getNode(),
2392+ // function () {
2393+ // setTimeout(() => {
2394+ // const {
2395+ // top: thumbTop,
2396+ // height: thumbHeight,
2397+ // left: thumbLeft,
2398+ // width: thumbWidth,
2399+ // } = this.thumbXElement.getBoundingClientRect();
2400+ //
2401+ // const { height: trackHeight, width: trackWidth } = this.trackXElement.getBoundingClientRect();
2402+ //
2403+ // simulant.fire(this.thumbXElement, "mousedown", {
2404+ // button: 0,
2405+ // clientY: thumbTop + thumbHeight / 2,
2406+ // clientX: thumbLeft + thumbWidth / 2,
2407+ // });
2408+ //
2409+ // setTimeout(() => {
2410+ // simulant.fire(document, "mousemove", {
2411+ // button: 0,
2412+ // clientY: thumbTop + trackHeight,
2413+ // clientX: thumbLeft + trackWidth,
2414+ // });
2415+ //
2416+ // setTimeout(() => {
2417+ // simulant.fire(document, "mouseup", {
2418+ // button: 0,
2419+ // clientY: thumbTop + trackHeight,
2420+ // clientX: thumbLeft + trackWidth,
2421+ // });
2422+ //
2423+ // setTimeout(() => {
2424+ // expect(this.scrollValues.scrollLeft).toBe(
2425+ // this.scrollValues.scrollWidth - this.scrollValues.clientWidth
2426+ // );
2427+ // expect(this.scrollValues.scrollTop).toBe(0);
2428+ // done();
2429+ // }, 20);
2430+ // }, 5);
2431+ // }, 5);
2432+ // }, 20);
2433+ // }
2434+ // );
2435+ // });
24362436 } ) ;
24372437} ) ;
0 commit comments