fix: cursor not showing on game start
Issue: When game starts, renderBoard() rebuilds DOM which removes cursor class Solution: Add gameStatus as dependency to useCursorRender - Now re-applies cursor after board renders - Only applies cursor when gameStatus === 'started' This ensures cursor is visible immediately when game starts at position (0,0).
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ export function useGame(options: GameOptions = {}, platformHook?: unknown): Game
|
||||
const cursor = useCursor(gameStatusManager);
|
||||
const cursorPosition = cursor.position();
|
||||
|
||||
useCursorRender(containerRef, cursorPosition);
|
||||
useCursorRender(containerRef, cursorPosition, gameStatus);
|
||||
|
||||
const [keyLog, setKeyLog] = useState<{ key: string; timestamp: number }[]>([]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user