Merge pull request #11398 from strapi/search-query-fix

QA/ Search query fix
This commit is contained in:
cyril lopez 2021-10-29 07:33:51 +02:00 committed by GitHub
commit 27ec1d268b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,12 @@ const Search = ({ label, trackedEvent }) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [value]);
useEffect(() => {
if (value && !isOpen) {
setIsOpen(true);
}
}, [value, isOpen]);
if (isOpen) {
return (
<div ref={wrapperRef}>