diff --git a/src/applications/mhv-medications/containers/Prescriptions.jsx b/src/applications/mhv-medications/containers/Prescriptions.jsx index 71ee9d69ffb5..1b58707a760e 100644 --- a/src/applications/mhv-medications/containers/Prescriptions.jsx +++ b/src/applications/mhv-medications/containers/Prescriptions.jsx @@ -201,11 +201,16 @@ const Prescriptions = () => { useEffect( () => { - if (!filteredList?.length) { + if ( + !isLoading && + filteredList?.length === 0 && + filterCount && + Object.values(filterCount).some(value => value !== 0) + ) { focusElement(document.getElementById('no-matches-msg')); } }, - [filteredList], + [filteredList, isLoading, filterCount], ); useEffect( @@ -733,10 +738,12 @@ const Prescriptions = () => { )} - + {(!showFilterContent || !isLoading) && ( + + )}
{isLoading ? (
@@ -759,24 +766,25 @@ const Prescriptions = () => { updateLoadingStatus={updateLoadingStatus} /> )} - {showFilterContent && ( - <> - - - - )} + {showFilterContent && + !isLoading && ( + <> + + + + )} ) : ( <> @@ -793,7 +801,8 @@ const Prescriptions = () => { )} {showFilterContent && ( <> - {filteredList?.length === 0 && + {!isLoading && + filteredList?.length === 0 && filterCount && Object.values(filterCount).some( value => value !== 0,