Skip to content

Commit 5d1ff93

Browse files
committed
refactor(aria/grid): Add accessors for pattern properties
1 parent 5cf2fc0 commit 5d1ff93

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/aria/grid/grid.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ export class Grid {
7777
/** The wrapping behavior for keyboard navigation along the column axis. */
7878
readonly colWrap = input<'continuous' | 'loop' | 'nowrap'>('loop');
7979

80+
/** The currently active cell. */
81+
readonly activeCell = computed(() => this._pattern.activeCell());
82+
83+
/** Whether the user is currently dragging to select a range of cells. */
84+
readonly dragging = computed(() => this._pattern.dragging());
85+
86+
/** Whether the focus is in the grid. */
87+
readonly isFocused = computed(() => this._pattern.isFocused());
88+
89+
/** Whether to pause grid navigation. */
90+
readonly pauseNavigation = computed(() => this._pattern.pauseNavigation());
91+
8092
/** The UI pattern for the grid. */
8193
readonly _pattern = new GridPattern({
8294
...this,

0 commit comments

Comments
 (0)