-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Add escapeKeyBehavior to GridList/ListBox/Menu/Table/Tree #7974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
ef14567
1f0bf48
0347a67
57209d3
31adda0
254c950
43a2ef9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,12 @@ export interface GridProps extends DOMProps, AriaLabelingProps { | |
| /** Handler that is called when a user performs an action on the row. */ | ||
| onRowAction?: (key: Key) => void, | ||
| /** Handler that is called when a user performs an action on the cell. */ | ||
| onCellAction?: (key: Key) => void | ||
| onCellAction?: (key: Key) => void, | ||
| /** | ||
| * Whether the grid allows the user to clear all selected items via Escape. | ||
| * @default false | ||
| */ | ||
| disallowClearAll?: boolean | ||
|
||
| } | ||
|
|
||
| export interface GridAria { | ||
|
|
@@ -77,7 +82,8 @@ export function useGrid<T>(props: GridProps, state: GridState<T, GridCollection< | |
| scrollRef, | ||
| getRowText, | ||
| onRowAction, | ||
| onCellAction | ||
| onCellAction, | ||
| disallowClearAll = false | ||
| } = props; | ||
| let {selectionManager: manager} = state; | ||
|
|
||
|
|
@@ -106,7 +112,8 @@ export function useGrid<T>(props: GridProps, state: GridState<T, GridCollection< | |
| keyboardDelegate: delegate, | ||
| isVirtualized, | ||
| scrollRef, | ||
| disallowTypeAhead | ||
| disallowTypeAhead, | ||
| disallowClearAll | ||
| }); | ||
|
|
||
| let id = useId(props.id); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.