Skip to content

Commit 5c06d0c

Browse files
committed
refactor(aria/listbox): Add accessors for pattern properties
1 parent 210446a commit 5c06d0c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/aria/listbox/listbox.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import {ComboboxPopup} from '../combobox';
5151
'[attr.aria-disabled]': '_pattern.disabled()',
5252
'[attr.aria-orientation]': '_pattern.orientation()',
5353
'[attr.aria-multiselectable]': '_pattern.multi()',
54-
'[attr.aria-activedescendant]': '_pattern.activedescendant()',
54+
'[attr.aria-activedescendant]': 'activedescendant()',
5555
'(keydown)': '_pattern.onKeydown($event)',
5656
'(pointerdown)': '_pattern.onPointerdown($event)',
5757
'(focusin)': 'onFocus()',
@@ -118,6 +118,12 @@ export class Listbox<V> {
118118
/** The values of the current selected items. */
119119
value = model<V[]>([]);
120120

121+
/** The id of the current active item. */
122+
readonly activedescendant = computed(() => this._pattern.activedescendant());
123+
124+
/** Whether selection should follow focus. */
125+
readonly followFocus = computed(() => this._pattern.followFocus());
126+
121127
/** The Listbox UIPattern. */
122128
readonly _pattern: ListboxPattern<V>;
123129

0 commit comments

Comments
 (0)