Skip to content

Commit 1fdfef2

Browse files
committed
Fix ID trimming in the group ID to name converter
1 parent 291c188 commit 1fdfef2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/groupschema.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1>Spore Group Schema</h1>
1616
<fieldset id="ID2Name">
1717
<legend>Enter a group ID to convert:</legend>
1818

19-
<input id="ID" placeholder="Group ID" autofocus maxlength="8">
19+
<input id="ID" placeholder="Group ID" autofocus maxlength="10">
2020
<input id="Name" placeholder="Name" readonly>
2121

2222
<div>

docs/js/groupschema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ID2NAME_ID_INPUT.addEventListener("input", () => {
2525
if (ID2NAME_ID_INPUT.value.startsWith("0x")) {
2626
ID2NAME_ID_INPUT.value = ID2NAME_ID_INPUT.value.replace("0x", "");
2727
}
28-
ID2NAME_ID_INPUT.value = ID2NAME_ID_INPUT.value.replace(/[^0-9a-fA-F]/g, "");
28+
ID2NAME_ID_INPUT.value = ID2NAME_ID_INPUT.value.replace(/[^0-9a-fA-F]/g, "").slice(0, 8);
2929
updateNameFromID();
3030
});
3131
ID2NAME_HIDE_DEFAULT_VARIANT_CHECKBOX.addEventListener("change", updateNameFromID);

0 commit comments

Comments
 (0)