• 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

4.0
/projects/igniteui-angular/src/lib/drop-down/drop-down-item.component.ts
1
import {
2
    Component,
3
    HostBinding
4
} from '@angular/core';
5
import { IgxDropDownItemBaseDirective } from './drop-down-item.base';
6

7
/**
8
 * The `<igx-drop-down-item>` is a container intended for row items in
9
 * a `<igx-drop-down>` container.
10
 */
11
@Component({
12
    selector: 'igx-drop-down-item',
13
    templateUrl: 'drop-down-item.component.html',
14
    standalone: true
15
})
16
export class IgxDropDownItemComponent extends IgxDropDownItemBaseDirective {
3✔
17
    /**
18
     * Sets/gets if the given item is focused
19
     * ```typescript
20
     *  let mySelectedItem = this.dropdown.selectedItem;
21
     *  let isMyItemFocused = mySelectedItem.focused;
22
     * ```
23
     */
24
    public override get focused(): boolean {
UNCOV
25
        let focusedState = this._focused;
×
UNCOV
26
        if (this.hasIndex) {
×
UNCOV
27
            const focusedItem = this.selection.first_item(`${this.dropDown.id}-active`);
×
UNCOV
28
            const focusedIndex = focusedItem ? focusedItem.index : -1;
×
UNCOV
29
            focusedState = this._index === focusedIndex;
×
30
        }
UNCOV
31
        return this.isSelectable && focusedState;
×
32
    }
33

34
    /**
35
     * Sets/gets if the given item is focused
36
     * ```typescript
37
     *  let mySelectedItem = this.dropdown.selectedItem;
38
     *  let isMyItemFocused = mySelectedItem.focused;
39
     * ```
40
     */
41
    public override set focused(value: boolean) {
UNCOV
42
        this._focused = value;
×
43
    }
44
    /**
45
     * Sets/Gets if the item is the currently selected one in the dropdown
46
     *
47
     * ```typescript
48
     *  let mySelectedItem = this.dropdown.selectedItem;
49
     *  let isMyItemSelected = mySelectedItem.selected; // true
50
     * ```
51
     *
52
     * Two-way data binding
53
     * ```html
54
     * <igx-drop-down-item [(selected)]='model.isSelected'></igx-drop-down-item>
55
     * ```
56
     */
57
    public override get selected(): boolean {
UNCOV
58
        if (this.hasIndex) {
×
UNCOV
59
            const item = this.selection.first_item(`${this.dropDown.id}`);
×
UNCOV
60
            return item ? item.index === this._index && item.value === this.value : false;
×
61
        }
UNCOV
62
        return this._selected;
×
63
    }
64

65
    /**
66
     * Sets/Gets if the item is the currently selected one in the dropdown
67
     *
68
     */
69
    public override set selected(value: boolean) {
UNCOV
70
        if (this.isHeader) {
×
UNCOV
71
            return;
×
72
        }
UNCOV
73
        this._selected = value;
×
UNCOV
74
        this.selectedChange.emit(this._selected);
×
75
    }
76
    /**
77
     * @hidden @internal
78
     */
79
    @HostBinding('attr.tabindex')
80
    public get setTabIndex() {
UNCOV
81
        const shouldSetTabIndex = this.dropDown.allowItemsFocus && this.isSelectable;
×
UNCOV
82
        if (shouldSetTabIndex) {
×
UNCOV
83
            return 0;
×
84
        } else {
UNCOV
85
            return null;
×
86
        }
87
    }
88

89
    public override clicked(event): void {
UNCOV
90
        if (!this.isSelectable) {
×
UNCOV
91
            this.ensureItemFocus();
×
UNCOV
92
            return;
×
93
        }
UNCOV
94
        if (this.selection) {
×
UNCOV
95
            this.dropDown.selectItem(this, event);
×
96
        }
97
    }
98
}
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