Skip to content

Commit

Permalink
Update SearchIcons.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Oct 1, 2024
1 parent ae2bbc9 commit 67b256a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/data/material/components/material-icons/SearchIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ function Icon(props) {
React.useEffect(() => {
const margin = 200;
const root = /** @type {SVGElement} */ (rootRef.current);
if (isElmVisible(root, margin)) {
if (initiallyVisible || isElmVisible(root, margin)) {
setIsVisible(true);
return () => {};
}
const observer = new IntersectionObserver(
(entries) => {
Expand All @@ -178,7 +179,7 @@ function Icon(props) {
return () => {
observer.disconnect();
};
}, []);
}, [initiallyVisible]);

/* eslint-disable jsx-a11y/click-events-have-key-events */
return (
Expand Down

0 comments on commit 67b256a

Please sign in to comment.