scroll to active move button only when needed

This commit is contained in:
Nathaniel Tampus
2023-03-12 21:24:24 +08:00
parent f7aba38d82
commit 055cc5781d

View File

@@ -106,7 +106,7 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) {
useEffect(() => {
const activeMoveEl = document.getElementById("activeNavMove");
if (!activeMoveEl) return;
activeMoveEl.scrollIntoView();
activeMoveEl.scrollIntoView({ inline: "nearest", block: "nearest" });
});
useEffect(() => {