From 0ebd5f8fce97a01e4ae123d66a228370eb595990 Mon Sep 17 00:00:00 2001 From: GeoffCoxMSFT Date: Mon, 9 Jan 2023 13:43:01 -0800 Subject: [PATCH 1/2] Set correct defaultRender --- .../pickers/Suggestions/Suggestions.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) 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; From 54bac9414d53394d2cbad633dbcbc2548deffa34 Mon Sep 17 00:00:00 2001 From: GeoffCoxMSFT Date: Mon, 9 Jan 2023 13:43:44 -0800 Subject: [PATCH 2/2] yarn change --- ...luentui-react-8abc6b6c-fcb2-4ec6-b72d-d68559917073.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-8abc6b6c-fcb2-4ec6-b72d-d68559917073.json 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" +}