diff --git a/change/@fluentui-react-tabster-59ed64de-6eec-46c5-b0d6-2cd22cba4d0c.json b/change/@fluentui-react-tabster-59ed64de-6eec-46c5-b0d6-2cd22cba4d0c.json new file mode 100644 index 00000000000000..98b1703843bd43 --- /dev/null +++ b/change/@fluentui-react-tabster-59ed64de-6eec-46c5-b0d6-2cd22cba4d0c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "make allowCondition a optional parameter for findAllFocusable function", + "packageName": "@fluentui/react-tabster", + "email": "marcosvmmoura@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-tabster/etc/react-tabster.api.md b/packages/react-components/react-tabster/etc/react-tabster.api.md index 4040a29519bd5b..6cd1a8a36a2200 100644 --- a/packages/react-components/react-tabster/etc/react-tabster.api.md +++ b/packages/react-components/react-tabster/etc/react-tabster.api.md @@ -64,7 +64,7 @@ export interface UseFocusableGroupOptions { // @public export const useFocusFinders: () => { - findAllFocusable: (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) => HTMLElement[]; + findAllFocusable: (container: HTMLElement, acceptCondition?: ((el: HTMLElement) => boolean) | undefined) => HTMLElement[]; findFirstFocusable: (container: HTMLElement) => HTMLElement | null | undefined; findLastFocusable: (container: HTMLElement) => HTMLElement | null | undefined; findNextFocusable: (currentElement: HTMLElement, options?: Pick) => HTMLElement | null | undefined; diff --git a/packages/react-components/react-tabster/src/hooks/useFocusFinders.ts b/packages/react-components/react-tabster/src/hooks/useFocusFinders.ts index 4f89d7f6a289b6..63763cc7039edd 100644 --- a/packages/react-components/react-tabster/src/hooks/useFocusFinders.ts +++ b/packages/react-components/react-tabster/src/hooks/useFocusFinders.ts @@ -10,7 +10,7 @@ export const useFocusFinders = () => { // Narrow props for now and let need dictate additional props in the future const findAllFocusable = React.useCallback( - (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) => + (container: HTMLElement, acceptCondition?: (el: HTMLElement) => boolean) => tabster?.focusable.findAll({ container, acceptCondition }) || [], [tabster], );