File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -489,6 +489,8 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
489
489
const { scrollWidth, clientWidth } = currentTarget ;
490
490
// There is no space to scroll
491
491
if ( scrollWidth === clientWidth ) {
492
+ setPingedLeft ( false ) ;
493
+ setPingedRight ( false ) ;
492
494
return ;
493
495
}
494
496
if ( isRTL ) {
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
1
import { mount } from 'enzyme' ;
3
- import { act } from 'react-dom/test-utils' ;
4
- import { resetWarned } from 'rc-util/lib/warning' ;
2
+ import RcResizeObserver from 'rc-resize-observer' ;
5
3
import { spyElementPrototype } from 'rc-util/lib/test/domHook' ;
4
+ import { resetWarned } from 'rc-util/lib/warning' ;
5
+ import { act } from 'react-dom/test-utils' ;
6
6
import Table from '../src' ;
7
- import RcResizeObserver from 'rc-resize-observer' ;
8
7
9
8
describe ( 'Table.FixedColumn' , ( ) => {
10
9
let domSpy ;
@@ -160,6 +159,23 @@ describe('Table.FixedColumn', () => {
160
159
wrapper . update ( ) ;
161
160
expect ( wrapper . find ( '.rc-table' ) . hasClass ( 'rc-table-ping-left' ) ) . toBeTruthy ( ) ;
162
161
expect ( wrapper . find ( '.rc-table' ) . hasClass ( 'rc-table-ping-right' ) ) . toBeFalsy ( ) ;
162
+
163
+ // Fullscreen
164
+ act ( ( ) => {
165
+ wrapper
166
+ . find ( '.rc-table-content' )
167
+ . props ( )
168
+ . onScroll ( {
169
+ currentTarget : {
170
+ scrollLeft : 0 ,
171
+ scrollWidth : 100 ,
172
+ clientWidth : 100 ,
173
+ } ,
174
+ } ) ;
175
+ } ) ;
176
+ wrapper . update ( ) ;
177
+ expect ( wrapper . find ( '.rc-table' ) . hasClass ( 'rc-table-ping-left' ) ) . toBeFalsy ( ) ;
178
+ expect ( wrapper . find ( '.rc-table' ) . hasClass ( 'rc-table-ping-right' ) ) . toBeFalsy ( ) ;
163
179
} ) ;
164
180
165
181
describe ( 'warning if fixed not continue' , ( ) => {
You can’t perform that action at this time.
0 commit comments