From 7b61d2b30c753e629fa329543376d9941499e36d Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Mon, 19 Aug 2024 20:33:44 +0700 Subject: [PATCH] Fix headerMessage wrapper render logic --- src/components/SelectionList/BaseSelectionList.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index 5165c83d45b3..bbc8615898df 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -687,12 +687,12 @@ function BaseSelectionList( )} {/* If we are loading new options we will avoid showing any header message. This is mostly because one of the header messages says there are no options. */} {/* This is misleading because we might be in the process of loading fresh options from the server. */} - {(((!isLoadingNewOptions || headerMessage !== translate('common.noResultsFound')) && !!headerMessage) || - (flattenedSections.allOptions.length === 0 && !showLoadingPlaceholder)) && ( - - {headerMessage} - - )} + {(!isLoadingNewOptions || headerMessage !== translate('common.noResultsFound') || (flattenedSections.allOptions.length === 0 && !showLoadingPlaceholder)) && + !!headerMessage && ( + + {headerMessage} + + )} {!!headerContent && headerContent} {flattenedSections.allOptions.length === 0 ? ( renderListEmptyContent()