Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix visual flash when selecting album from search results

anandbaburajan6024ef4fd8fd
diff --git a/web/apps/photos/src/components/Collections/AllAlbums.tsx b/web/apps/photos/src/components/Collections/AllAlbums.tsx
index f40952c0c0..af6e6de93d 100644
--- a/web/apps/photos/src/components/Collections/AllAlbums.tsx
+++ b/web/apps/photos/src/components/Collections/AllAlbums.tsx
@@ -61,11 +61,9 @@ export const AllAlbums: React.FC<AllAlbums> = ({
const fullScreen = useMediaQuery("(max-width: 428px)");
const [searchTerm, setSearchTerm] = useState("");
- useEffect(() => {
- if (!open) {
- setSearchTerm("");
- }
- }, [open]);
+ const handleExited = () => {
+ setSearchTerm("");
+ };
const onCollectionClick = (collectionID: number) => {
onSelectCollectionID(collectionID);
@@ -86,6 +84,7 @@ export const AllAlbums: React.FC<AllAlbums> = ({
<AllAlbumsDialog
{...{ open, onClose, fullScreen }}
slots={{ transition: SlideUpTransition }}
+ slotProps={{ transition: { onExited: handleExited } }}
fullWidth
>
<Title
diff --git a/web/packages/new/photos/components/CollectionSelector.tsx b/web/packages/new/photos/components/CollectionSelector.tsx
index 013ea6aa08..73eb310867 100644
--- a/web/packages/new/photos/components/CollectionSelector.tsx
+++ b/web/packages/new/photos/components/CollectionSelector.tsx
@@ -126,11 +126,9 @@ export const CollectionSelector: React.FC<CollectionSelectorProps> = ({
CollectionSummary[]
>([]);
- useEffect(() => {
- if (!open) {
- setSearchTerm("");
- }
- }, [open]);
+ const handleExited = () => {
+ setSearchTerm("");
+ };
useEffect(() => {
if (!attributes || !open) {
@@ -219,6 +217,7 @@ export const CollectionSelector: React.FC<CollectionSelectorProps> = ({
"@media (min-width: 491px)": { height: "100%" },
},
},
+ transition: { onExited: handleExited },
}}
>
<DialogTitle>