@@ -3552,6 +3552,50 @@ describe('IgxGrid - Filtering actions - Excel style filtering', () => {
3552
3552
const listItems = displayContainer . querySelectorAll ( 'igx-list-item' ) ;
3553
3553
expect ( listItems . length ) . toBe ( 10 , 'incorrect rendered list items count' ) ;
3554
3554
} ) ) ;
3555
+
3556
+ it ( 'should correctly display all items in search list after filtering it' , ( async ( ) => {
3557
+ // Add additional rows as prerequisite for the test
3558
+ for ( let index = 0 ; index < 5 ; index ++ ) {
3559
+ const newRow = {
3560
+ Downloads : index ,
3561
+ ID : index + 100 ,
3562
+ ProductName : 'New Sales Product ' + index ,
3563
+ ReleaseDate : new Date ( ) ,
3564
+ Released : false ,
3565
+ AnotherField : 'z'
3566
+ } ;
3567
+ grid . addRow ( newRow ) ;
3568
+ }
3569
+ fix . detectChanges ( ) ;
3570
+
3571
+ // Open excel style filtering component
3572
+ GridFunctions . clickExcelFilterIcon ( fix , 'ProductName' ) ;
3573
+ await wait ( 200 ) ;
3574
+ fix . detectChanges ( ) ;
3575
+
3576
+ // Scroll the search list to the middle.
3577
+ const gridNativeElement = fix . debugElement . query ( By . css ( 'igx-grid' ) ) . nativeElement ;
3578
+ const excelMenu = gridNativeElement . querySelector ( '.igx-excel-filter__menu' ) ;
3579
+ const searchComponent = excelMenu . querySelector ( '.igx-excel-filter__menu-main' ) ;
3580
+ const displayContainer = searchComponent . querySelector ( 'igx-display-container' ) ;
3581
+ const scrollbar = searchComponent . querySelector ( 'igx-virtual-helper' ) ;
3582
+ scrollbar . scrollTop = ( < HTMLElement > displayContainer ) . getBoundingClientRect ( ) . height / 2 ;
3583
+ await wait ( 200 ) ;
3584
+ fix . detectChanges ( ) ;
3585
+
3586
+ // Type string in search box
3587
+ const inputNativeElement = searchComponent . querySelector ( '.igx-input-group__input' ) ;
3588
+ sendInputNativeElement ( inputNativeElement , 'sale' , fix ) ;
3589
+ await wait ( 200 ) ;
3590
+ fix . detectChanges ( ) ;
3591
+
3592
+ // Verify the display container is within the bounds of the list
3593
+ const displayContainerRect = displayContainer . getBoundingClientRect ( ) ;
3594
+ const listNativeElement = searchComponent . querySelector ( '.igx-list' ) ;
3595
+ const listRect = listNativeElement . getBoundingClientRect ( ) ;
3596
+ expect ( displayContainerRect . top >= listRect . top ) . toBe ( true , 'displayContainer starts above list' ) ;
3597
+ expect ( displayContainerRect . bottom <= listRect . bottom ) . toBe ( true , 'displayContainer ends below list' ) ;
3598
+ } ) ) ;
3555
3599
} ) ;
3556
3600
3557
3601
const expectedResults = [ ] ;
@@ -3564,6 +3608,14 @@ function sendInput(element, text, fix) {
3564
3608
fix . detectChanges ( ) ;
3565
3609
}
3566
3610
3611
+ function sendInputNativeElement ( nativeElement , text , fix ) {
3612
+ nativeElement . value = text ;
3613
+ nativeElement . dispatchEvent ( new Event ( 'keydown' ) ) ;
3614
+ nativeElement . dispatchEvent ( new Event ( 'input' ) ) ;
3615
+ nativeElement . dispatchEvent ( new Event ( 'keyup' ) ) ;
3616
+ fix . detectChanges ( ) ;
3617
+ }
3618
+
3567
3619
function verifyFilterUIPosition ( filterUIContainer , grid ) {
3568
3620
const filterUiRightBorder = filterUIContainer . nativeElement . offsetParent . offsetLeft +
3569
3621
filterUIContainer . nativeElement . offsetLeft + filterUIContainer . nativeElement . offsetWidth ;
0 commit comments