• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-angular / 13561607909

27 Feb 2025 08:03AM UTC coverage: 91.644% (+0.003%) from 91.641%
13561607909

push

github

web-flow
fix(grid): Update grid cell active state selector specificity (#15402)

13328 of 15596 branches covered (85.46%)

26882 of 29333 relevant lines covered (91.64%)

33708.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/projects/igniteui-angular/src/lib/combo/combo-item.component.ts
1
import {
2
    Component,
3
    ElementRef,
4
    HostBinding,
5
    Inject,
6
    Input,
7
    booleanAttribute
8
} from '@angular/core';
9
import { IgxDropDownItemComponent } from '../drop-down/drop-down-item.component';
10
import { IGX_DROPDOWN_BASE, IDropDownBase, Navigate } from '../drop-down/drop-down.common';
11
import { IgxComboAPIService } from './combo.api';
12
import { IgxSelectionAPIService } from '../core/selection';
13
import { rem } from '../core/utils';
14
import { IgxCheckboxComponent } from '../checkbox/checkbox.component';
15

16
/** @hidden */
17
@Component({
18
    selector: 'igx-combo-item',
19
    templateUrl: 'combo-item.component.html',
20
    imports: [IgxCheckboxComponent]
21
})
22
export class IgxComboItemComponent extends IgxDropDownItemComponent {
2✔
23

24
    /**
25
     * Gets the height of a list item
26
     *
27
     * @hidden
28
     */
29
    @Input()
30
    public itemHeight: string | number = '';
2,874✔
31

32
    /** @hidden @internal */
33
    @HostBinding('style.height.rem')
34
    public get _itemHeightToRem() {
35
        if (this.itemHeight) {
32,640✔
36
            return rem(this.itemHeight);
1,398✔
37
        }
38
    }
39

40
    @HostBinding('attr.aria-label')
41
    @Input()
42
    public override get ariaLabel(): string {
43
        const valueKey = this.comboAPI.valueKey;
65,280✔
44
        return (valueKey !== null && this.value != null) ? this.value[valueKey] : this.value;
65,280✔
45
    }
46

47
    /** @hidden @internal */
48
    @Input({ transform: booleanAttribute })
49
    public singleMode: boolean;
50

51
    /**
52
     * @hidden
53
     */
54
    public override get itemID() {
55
        const valueKey = this.comboAPI.valueKey;
88,674✔
56
        return valueKey !== null ? this.value[valueKey] : this.value;
88,674✔
57
    }
58

59
    /**
60
     * @hidden
61
     */
62
    public get comboID() {
63
        return this.comboAPI.comboID;
×
64
    }
65

66
    /**
67
     * @hidden
68
     * @internal
69
     */
70
    public get disableTransitions() {
71
        return this.comboAPI.disableTransitions;
23,391✔
72
    }
73

74
    constructor(
75
        protected comboAPI: IgxComboAPIService,
2,874✔
76
        @Inject(IGX_DROPDOWN_BASE) dropDown: IDropDownBase,
77
        elementRef: ElementRef,
78
        @Inject(IgxSelectionAPIService) selection: IgxSelectionAPIService
79
    ) {
80
        super(dropDown, elementRef, null, selection);
2,874✔
81
    }
82

83
    /**
84
     * @hidden
85
     */
86
    public override get selected(): boolean {
87
        return this.comboAPI.is_item_selected(this.itemID);
88,610✔
88
    }
89

90
    public override set selected(value: boolean) {
91
        if (this.isHeader) {
×
92
            return;
×
93
        }
94
        this._selected = value;
×
95
    }
96

97
    /**
98
     * @hidden
99
     */
100
    public isVisible(direction: Navigate): boolean {
101
        const rect = this.element.nativeElement.getBoundingClientRect();
×
102
        const parentDiv = this.element.nativeElement.parentElement.parentElement.getBoundingClientRect();
×
103
        if (direction === Navigate.Down) {
×
104
            return rect.y + rect.height <= parentDiv.y + parentDiv.height;
×
105
        }
106
        return rect.y >= parentDiv.y;
×
107
    }
108

109
    public override clicked(event): void {
110
        this.comboAPI.disableTransitions = false;
49✔
111
        if (!this.isSelectable) {
49✔
112
            return;
3✔
113
        }
114
        this.dropDown.navigateItem(this.index);
46✔
115
        this.comboAPI.set_selected_item(this.itemID, event);
46✔
116
    }
117

118
    /**
119
     * @hidden
120
     * @internal
121
     * The event that is prevented is the click on the checkbox label element.
122
     * That is the only visible element that a user can interact with.
123
     * The click propagates to the host and the preventDefault is to stop it from
124
     * switching focus to the input it's base on.
125
     * The toggle happens in an internal handler in the drop-down on the next task queue cycle.
126
     */
127
    public disableCheck(event: MouseEvent) {
128
        event.preventDefault();
1✔
129
    }
130
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc