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

IgniteUI / igniteui-angular / 16193550997

10 Jul 2025 11:12AM UTC coverage: 4.657% (-87.0%) from 91.64%
16193550997

Pull #16028

github

web-flow
Merge f7a9963b8 into 87246e3ce
Pull Request #16028: fix(radio-group): dynamically added radio buttons do not initialize

178 of 15764 branches covered (1.13%)

18 of 19 new or added lines in 2 files covered. (94.74%)

25721 existing lines in 324 files now uncovered.

1377 of 29570 relevant lines covered (4.66%)

0.53 hits per line

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

3.7
/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 {
3✔
23

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

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

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

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

51
    /**
52
     * @hidden
53
     */
54
    public override get itemID() {
UNCOV
55
        const valueKey = this.comboAPI.valueKey;
×
UNCOV
56
        return valueKey !== null ? this.value[valueKey] : this.value;
×
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() {
UNCOV
71
        return this.comboAPI.disableTransitions;
×
72
    }
73

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

83
    /**
84
     * @hidden
85
     */
86
    public override get selected(): boolean {
UNCOV
87
        return this.comboAPI.is_item_selected(this.itemID);
×
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 {
UNCOV
110
        this.comboAPI.disableTransitions = false;
×
UNCOV
111
        if (!this.isSelectable) {
×
UNCOV
112
            return;
×
113
        }
UNCOV
114
        this.dropDown.navigateItem(this.index);
×
UNCOV
115
        this.comboAPI.set_selected_item(this.itemID, event);
×
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) {
UNCOV
128
        event.preventDefault();
×
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