Skip to content

Commit 4646a50

Browse files
authored
Merge branch 'master' into MKamenov/fix-mrl-pinning-background
2 parents fd31bb0 + 564d064 commit 4646a50

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

projects/igniteui-angular/src/lib/carousel/carousel.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ export class IgxCarouselComponent implements OnDestroy {
448448

449449
this.onSlideChanged.emit({ carousel: this, slide });
450450
this._restartInterval();
451-
requestAnimationFrame(() => this.nativeElement.focus());
452451
}
453452
/**
454453
*@hidden
@@ -482,13 +481,15 @@ export class IgxCarouselComponent implements OnDestroy {
482481
@HostListener('keydown.arrowright')
483482
public onKeydownArrowRight() {
484483
this.next();
484+
requestAnimationFrame(() => this.nativeElement.focus());
485485
}
486486
/**
487487
*@hidden
488488
*/
489489
@HostListener('keydown.arrowleft')
490490
public onKeydownArrowLeft() {
491491
this.prev();
492+
requestAnimationFrame(() => this.nativeElement.focus());
492493
}
493494
}
494495

projects/igniteui-angular/src/lib/grids/filtering/grid-filtering-row.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
484484
*/
485485
public onDateSelected(value: Date) {
486486
this.value = value;
487+
this.commitInput();
487488
}
488489

489490
/**

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,6 +2494,37 @@ describe('IgxGrid - Filtering Row UI actions', () => {
24942494
dropdownList = fix.debugElement.query(By.css('div.igx-drop-down__list.igx-toggle'));
24952495
expect(dropdownList).toBeNull();
24962496
}));
2497+
2498+
it('Should commit the input and new chip after picking date from calendar for filtering.', fakeAsync(() => {
2499+
// Click date filter chip to show filter row.
2500+
const filterCells = fix.debugElement.queryAll(By.directive(IgxGridFilteringCellComponent));
2501+
const dateFilterCell = filterCells.find((fc) => fc.componentInstance.column.field === 'ReleaseDate');
2502+
const dateFilterCellChip = dateFilterCell.query(By.directive(IgxChipComponent));
2503+
dateFilterCellChip.nativeElement.click();
2504+
tick(100);
2505+
fix.detectChanges();
2506+
2507+
// Click input to open calendar.
2508+
const filteringRow = fix.debugElement.query(By.directive(IgxGridFilteringRowComponent));
2509+
const input = filteringRow.query(By.directive(IgxInputDirective));
2510+
input.nativeElement.click();
2511+
tick(100);
2512+
fix.detectChanges();
2513+
2514+
// Click the today date.
2515+
const outlet = document.getElementsByClassName('igx-grid__outlet')[0];
2516+
const calendar = outlet.getElementsByClassName('igx-calendar')[0];
2517+
const todayDayItem = calendar.querySelector('.igx-calendar__date--current');
2518+
(<HTMLElement>todayDayItem).click();
2519+
tick(100);
2520+
fix.detectChanges();
2521+
2522+
// Verify the chip and input are committed.
2523+
const activeFiltersArea = filteringRow.query(By.css('.igx-grid__filtering-row-main'));
2524+
const activeFilterChip = activeFiltersArea.query(By.directive(IgxChipComponent));
2525+
expect((<IgxChipComponent>activeFilterChip.componentInstance).selected).toBe(false, 'chip is not committed');
2526+
expect((<IgxInputDirective>input.componentInstance).value).toBeNull('input value is present and not committed');
2527+
}));
24972528
});
24982529

24992530
describe(null, () => {

0 commit comments

Comments
 (0)