diff --git a/change/@fluentui-react-8abc6b6c-fcb2-4ec6-b72d-d68559917073.json b/change/@fluentui-react-8abc6b6c-fcb2-4ec6-b72d-d68559917073.json new file mode 100644 index 0000000000000..10ee397de7033 --- /dev/null +++ b/change/@fluentui-react-8abc6b6c-fcb2-4ec6-b72d-d68559917073.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Set correct defaultRender for no results found", + "packageName": "@fluentui/react", + "email": "gcox@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react/src/components/pickers/Suggestions/Suggestions.tsx b/packages/react/src/components/pickers/Suggestions/Suggestions.tsx index 3c76a28768589..0ef0749a125f4 100644 --- a/packages/react/src/components/pickers/Suggestions/Suggestions.tsx +++ b/packages/react/src/components/pickers/Suggestions/Suggestions.tsx @@ -146,16 +146,18 @@ export class Suggestions extends React.Component, ISugge className: css('ms-Suggestions-spinner', legacyStyles.suggestionsSpinner), }; - const noResults = () => ( - // This ID can be used by the parent to set aria-activedescendant to this -
- {onRenderNoResultFound ? ( - onRenderNoResultFound(undefined, noResults) - ) : ( -
{noResultsFoundText}
- )} -
- ); + const noResults = () => { + const defaultRender = () => { + return
{noResultsFoundText}
; + }; + + return ( + // This ID can be used by the parent to set aria-activedescendant to this +
+ {onRenderNoResultFound ? onRenderNoResultFound(undefined, defaultRender) : defaultRender()} +
+ ); + }; // MostRecently Used text should supercede the header text if it's there and available. let headerText: string | undefined = suggestionsHeaderText;