diff --git a/frontend/src/components/TicketsList/index.js b/frontend/src/components/TicketsList/index.js index d10b3e9..37e5de5 100644 --- a/frontend/src/components/TicketsList/index.js +++ b/frontend/src/components/TicketsList/index.js @@ -179,12 +179,12 @@ const reducer = (state, action) => { type: "LOAD_TICKETS", payload: tickets, }); - }, [tickets, status, searchParam]); + }, [tickets]); useEffect(() => { const socket = openSocket(); - const shouldUpdateTicket = ticket => + const shouldUpdateTicket = ticket => !searchParam && (!ticket.userId || ticket.userId === user?.id || showAll) && (!ticket.queueId || selectedQueueIds.indexOf(ticket.queueId) > -1); @@ -244,7 +244,7 @@ const reducer = (state, action) => { return () => { socket.disconnect(); }; - }, [status, showAll, user, selectedQueueIds]); + }, [status, searchParam, showAll, user, selectedQueueIds]); useEffect(() => { if (typeof updateCount === "function") { @@ -263,6 +263,7 @@ const reducer = (state, action) => { const { scrollTop, scrollHeight, clientHeight } = e.currentTarget; if (scrollHeight - (scrollTop + 100) < clientHeight) { + e.currentTarget.scrollTop = scrollTop - 100; loadMore(); } }; diff --git a/frontend/src/components/TicketsManager/index.js b/frontend/src/components/TicketsManager/index.js index 88e6ea0..6888322 100644 --- a/frontend/src/components/TicketsManager/index.js +++ b/frontend/src/components/TicketsManager/index.js @@ -118,6 +118,7 @@ const TicketsManager = () => { useEffect(() => { if (tab === "search") { searchInputRef.current.focus(); + setSearchParam(""); } }, [tab]);