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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: add modalizer id to `useModalAttributes` option",
"packageName": "@fluentui/react-tabster",
"email": "yuanboxue@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const useModalAttributes: (options?: UseModalAttributesOptions) => {
// @public (undocumented)
export interface UseModalAttributesOptions {
alwaysFocusable?: boolean;
id?: string;
legacyTrapFocus?: boolean;
trapFocus?: boolean;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export interface UseModalAttributesOptions {
* Always reachabled in Tab order
*/
alwaysFocusable?: boolean;

/**
* Id to use for the modalizer. An id will be generated if not provided.
*/
id?: string;
Comment thread
YuanboXue-Amber marked this conversation as resolved.
}

/**
Expand All @@ -44,7 +49,7 @@ export const useModalAttributes = (
getDeloser(tabster);
}

const id = useId('modal-');
const id = useId('modal-', options.id);
const modalAttributes = useTabsterAttributes({
deloser: {},
modalizer: {
Expand Down