Skip to content

Commit 440a899

Browse files
committed
refactor(aria/toolbar): Add accessors for pattern properties
1 parent 9a9319a commit 440a899

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/aria/toolbar/toolbar.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class Toolbar<V> {
168168
exportAs: 'ngToolbarWidget',
169169
host: {
170170
'class': 'ng-toolbar-widget',
171-
'[attr.data-active]': '_pattern.active()',
171+
'[attr.data-active]': 'active()',
172172
'[attr.tabindex]': '_pattern.tabIndex()',
173173
'[attr.inert]': 'hardDisabled() ? true : null',
174174
'[attr.disabled]': 'hardDisabled() ? true : null',
@@ -201,15 +201,15 @@ export class ToolbarWidget<V> implements OnInit, OnDestroy {
201201
/** Whether the widget is 'hard' disabled, which is different from `aria-disabled`. A hard disabled widget cannot receive focus. */
202202
readonly hardDisabled = computed(() => this._pattern.disabled() && !this._toolbar.softDisabled());
203203

204+
/** Whether the widget is currently the active one (focused). */
205+
readonly active = computed(() => this._pattern.active);
206+
204207
/** The optional ToolbarWidgetGroup this widget belongs to. */
205208
readonly _group = inject(ToolbarWidgetGroup, {optional: true});
206209

207210
/** The value associated with the widget. */
208211
readonly value = input.required<V>();
209212

210-
/** Whether the widget is currently active (focused). */
211-
readonly active = computed(() => this._pattern.active());
212-
213213
/** Whether the widget is selected (only relevant in a selection group). */
214214
readonly selected = () => this._pattern.selected();
215215

0 commit comments

Comments
 (0)