Skip to content

Commit

Permalink
Fixes #3. Remove LAST place now sets focus to end
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenSem authored Jul 30, 2023
1 parent de20f03 commit 4403165
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@
const removePlace = (index) => {
const newPlaces = [...places];
newPlaces.splice(index, 1);
focusIndex(index, FOCUS_DELAY_SECONDARY);
focusIndex(
index < newPlaces.length
? index
: newPlaces.length - 1,
FOCUS_DELAY_SECONDARY
);
setPlaces(newPlaces);
};

Expand Down

0 comments on commit 4403165

Please sign in to comment.