Skip to content

Commit d8ccbaa

Browse files
authored
Merge branch '18.2.x' into igniteui-angular-15002-18-2-x
2 parents b63f987 + 90b3403 commit d8ccbaa

File tree

4 files changed

+27
-28
lines changed

4 files changed

+27
-28
lines changed

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,71 +1745,60 @@ describe('igxCombo', () => {
17451745
expect(dropdown).toBeDefined();
17461746
expect(dropdown.focusedItem).toBeFalsy();
17471747
expect(combo.virtualScrollContainer).toBeDefined();
1748+
combo.allowCustomValues = true;
17481749
const mockClick = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']);
17491750
const virtualMockUP = spyOn<any>(dropdown, 'navigatePrev').and.callThrough();
17501751
const virtualMockDOWN = spyOn<any>(dropdown, 'navigateNext').and.callThrough();
17511752
expect(dropdown.focusedItem).toEqual(null);
17521753
expect(combo.collapsed).toBeTruthy();
17531754
combo.toggle();
1754-
await wait(30);
1755+
await wait();
17551756
fixture.detectChanges();
17561757
expect(combo.collapsed).toBeFalsy();
17571758
combo.virtualScrollContainer.scrollTo(51);
1758-
await wait(30);
1759+
await firstValueFrom(combo.virtualScrollContainer.chunkLoad);
17591760
fixture.detectChanges();
17601761
let items = fixture.debugElement.queryAll(By.css(`.${CSS_CLASS_DROPDOWNLISTITEM}`));
17611762
let lastItem = items[items.length - 1].componentInstance;
17621763
expect(lastItem).toBeDefined();
17631764
lastItem.clicked(mockClick);
1764-
await wait(30);
17651765
fixture.detectChanges();
17661766
expect(dropdown.focusedItem).toEqual(lastItem);
17671767
dropdown.navigateItem(-1);
1768-
await wait(30);
17691768
fixture.detectChanges();
17701769
expect(virtualMockDOWN).toHaveBeenCalledTimes(0);
17711770
lastItem.clicked(mockClick);
1772-
await wait(30);
17731771
fixture.detectChanges();
17741772
expect(dropdown.focusedItem).toEqual(lastItem);
17751773
dropdown.navigateNext();
1776-
await wait(30);
17771774
fixture.detectChanges();
17781775
expect(virtualMockDOWN).toHaveBeenCalledTimes(1);
17791776
combo.searchValue = 'New';
17801777
combo.handleInputChange();
17811778
fixture.detectChanges();
1782-
await wait(30);
1783-
items = fixture.debugElement.queryAll(By.css(`.${CSS_CLASS_DROPDOWNLISTITEM}`));
1784-
lastItem = items[items.length - 1].componentInstance;
1785-
(lastItem as IgxComboAddItemComponent).clicked(mockClick);
1786-
await wait(30);
1779+
await firstValueFrom(combo.virtualScrollContainer.chunkLoad);
1780+
const addItemButton = fixture.debugElement.query(By.directive(IgxComboAddItemComponent));
1781+
addItemButton.triggerEventHandler('click', UIInteractions.getMouseEvent('click'));
17871782
fixture.detectChanges();
17881783
// After `Add Item` is clicked, the input is focused and the item is added to the list
1789-
// expect(dropdown.focusedItem).toEqual(null);
1784+
expect(dropdown.focusedItem).toEqual(null);
17901785
expect(document.activeElement).toEqual(combo.searchInput.nativeElement);
17911786
expect(combo.customValueFlag).toBeFalsy();
17921787
expect(combo.searchInput.nativeElement.value).toBeTruthy();
17931788

17941789
// TEST move from first item
1795-
combo.virtualScrollContainer.scrollTo(0);
1796-
await wait();
1797-
fixture.detectChanges();
17981790
const firstItem = fixture.debugElement.queryAll(By.css(`.${CSS_CLASS_DROPDOWNLISTITEM}`))[0].componentInstance;
17991791
firstItem.clicked(mockClick);
1800-
await wait(30);
18011792
fixture.detectChanges();
18021793
expect(dropdown.focusedItem).toEqual(firstItem);
18031794
expect(dropdown.focusedItem.itemIndex).toEqual(0);
1804-
// spyOnProperty(dropdown, 'focusedItem', 'get').and.returnValue(firstItem);
18051795
dropdown.navigateFirst();
1806-
await wait(30);
18071796
fixture.detectChanges();
18081797
dropdown.navigatePrev();
1809-
await wait(30);
18101798
fixture.detectChanges();
1811-
// Called once before the `await` and called once more, because item @ index 0 is a header
1799+
// Called once manually and called once more, because item @ index 0 is a header
18121800
expect(virtualMockUP).toHaveBeenCalledTimes(2);
1801+
expect(dropdown.focusedItem).toBeNull();
18131802
}));
18141803
it('should properly get the first focusable item when focusing the component list', () => {
18151804
const expectedItemText = 'State: MichiganRegion: East North Central';

projects/igniteui-angular/src/lib/core/styles/components/drop-down/_drop-down-theme.scss

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,16 +404,16 @@
404404
}
405405
}
406406

407-
/// Adds typography styles for the igx-list component.
408-
/// Uses the 'caption' and 'subtitle-2'
407+
/// Adds typography styles for the igx-drop-down component.
408+
/// Uses the 'overline', 'body-2', 'subtitle-1'
409409
/// categories from the typographic scale.
410410
/// @group typography
411-
/// @param {Map} $categories [(header: 'overline', item: 'body-2', select-item: 'subtitle-1')] - The categories from the typographic scale used for type styles.
411+
/// @param {Map} $categories [(header: 'overline', item: 'body-2', select-item: 'body-2')] - The categories from the typographic scale used for type styles.
412412
@mixin drop-down-typography(
413413
$categories: (
414414
header: 'overline',
415415
item: 'body-2',
416-
select-item: 'subtitle-1'
416+
select-item: 'body-2'
417417
)
418418
) {
419419
$header: map.get($categories, 'header');
@@ -432,4 +432,10 @@
432432
margin: 0;
433433
}
434434
}
435+
436+
%igx-drop-down__item--selected {
437+
@include type-style($select-item) {
438+
margin: 0;
439+
}
440+
}
435441
}

projects/igniteui-angular/src/lib/core/styles/typography/_bootstrap.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@
6464
));
6565
@include dock-manager-typography();
6666
@include drop-down-typography($categories: (
67-
header: 'body-1',
68-
item: 'body-1',
69-
select-item: 'body-1'
67+
header: 'overline',
68+
item: 'body-2',
69+
select-item: 'body-2'
7070
));
7171
@include expansion-panel-typography($categories: (
7272
title: 'h5',

projects/igniteui-angular/src/lib/core/styles/typography/_fluent.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@
6666
content: 'body-2'
6767
));
6868
@include dock-manager-typography();
69-
@include drop-down-typography();
69+
@include drop-down-typography($categories: (
70+
header: 'subtitle-2',
71+
item: 'body-2',
72+
select-item: 'body-2'
73+
));
7074
@include expansion-panel-typography($categories: (
7175
title: 'subtitle-1',
7276
description: 'body-2',

0 commit comments

Comments
 (0)