From b4e3b179719ee9e8b05b87beb4f44ab408069920 Mon Sep 17 00:00:00 2001 From: Andrio Celos Date: Mon, 4 Dec 2023 09:55:34 +1100 Subject: [PATCH] Fix test highlight persisting after removing the card --- TableturfBattleClient/src/Pages/GamePage.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TableturfBattleClient/src/Pages/GamePage.ts b/TableturfBattleClient/src/Pages/GamePage.ts index 9c10e98..4b01bef 100644 --- a/TableturfBattleClient/src/Pages/GamePage.ts +++ b/TableturfBattleClient/src/Pages/GamePage.ts @@ -502,6 +502,11 @@ function testPlacementListItem_pointerleave(button: HTMLButtonElement, placement testUndoButton.buttonElement.addEventListener('click', () => { const turn = testPlacements.pop(); if (turn) { + // Remove the highlight if needed. + for (const p of turn.placementResults.placements[0].spacesAffected) + board.setTestHighlight(p.space.x, p.space.y, false); + + // Undo the placement. undoTurn(turn.placementResults); testPlacementList.removeChild(testPlacementList.firstChild!);