Skip to content

Commit 4403165

Browse files
authored
Fixes #3. Remove LAST place now sets focus to end
1 parent de20f03 commit 4403165

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,12 @@
267267
const removePlace = (index) => {
268268
const newPlaces = [...places];
269269
newPlaces.splice(index, 1);
270-
focusIndex(index, FOCUS_DELAY_SECONDARY);
270+
focusIndex(
271+
index < newPlaces.length
272+
? index
273+
: newPlaces.length - 1,
274+
FOCUS_DELAY_SECONDARY
275+
);
271276
setPlaces(newPlaces);
272277
};
273278

0 commit comments

Comments
 (0)