diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js index e54d1e6..243f016 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js @@ -94,29 +94,38 @@ const Morceaux = () => { const json = await response.json(); setProducts([...json]); setIsLoading(false); + } + const handleScroll = async (e) => { + const target = e.target; + if (!isLoading && !isSearch) { + if (target.scrollTop + target.clientHeight + 300 >= target.scrollHeight) { + await handleNextItems(); + } + } } return ( -