Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/aria/grid/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class GridRow {
'[attr.id]': '_pattern.id()',
'[attr.rowspan]': '_pattern.rowSpan()',
'[attr.colspan]': '_pattern.colSpan()',
'[attr.data-active]': '_pattern.active()',
'[attr.data-active]': 'active()',
'[attr.data-anchor]': '_pattern.anchor()',
'[attr.aria-disabled]': '_pattern.disabled()',
'[attr.aria-rowspan]': '_pattern.rowSpan()',
Expand All @@ -254,6 +254,9 @@ export class GridCell {
/** A reference to the host element. */
readonly element = this._elementRef.nativeElement as HTMLElement;

/** Whether the cell is currently active (focused). */
readonly active = computed(() => this._pattern.active());

/** The widgets contained within this cell, if any. */
private readonly _widgets = contentChildren(GridCellWidget, {descendants: true});

Expand Down Expand Up @@ -362,7 +365,7 @@ export class GridCell {
exportAs: 'ngGridCellWidget',
host: {
'class': 'grid-cell-widget',
'[attr.data-active]': '_pattern.active()',
'[attr.data-active]': 'active()',
'[attr.data-active-control]': 'isActivated() ? "widget" : "cell"',
'[tabindex]': '_tabIndex()',
},
Expand All @@ -374,6 +377,9 @@ export class GridCellWidget {
/** A reference to the host element. */
readonly element = this._elementRef.nativeElement as HTMLElement;

/** Whether the widget is currently active (focused). */
readonly active = computed(() => this._pattern.active());

/** The parent cell. */
private readonly _cell = inject(GridCell);

Expand Down
5 changes: 4 additions & 1 deletion src/aria/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class Listbox<V> {
exportAs: 'ngOption',
host: {
'role': 'option',
'[attr.data-active]': '_pattern.active()',
'[attr.data-active]': 'active()',
'[attr.id]': '_pattern.id()',
'[attr.tabindex]': '_pattern.tabIndex()',
'[attr.aria-selected]': '_pattern.selected()',
Expand All @@ -242,6 +242,9 @@ export class Option<V> {
/** A reference to the host element. */
readonly element = this._elementRef.nativeElement as HTMLElement;

/** Whether the option is currently active (focused). */
active = computed(() => this._pattern.active());

/** The parent Listbox. */
private readonly _listbox = inject(Listbox);

Expand Down
Loading