Prevent duplicate IDs
This commit is contained in:
parent
ea014fee10
commit
5aee7e4a29
1 changed files with 5 additions and 2 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import { localizer } from "../../utils/Localizer.mjs";
|
||||
|
||||
const { randomID } = foundry.utils;
|
||||
|
||||
export function stringSet(input, data) {
|
||||
const label = localizer(input.label);
|
||||
const id = `${data.meta.idp}-${randomID(10)}`;
|
||||
|
||||
if (!data.meta.editable) {
|
||||
return `<div data-input-type="string-set">
|
||||
|
|
@ -12,12 +15,12 @@ export function stringSet(input, data) {
|
|||
|
||||
return `<div data-input-type="string-set">
|
||||
<label
|
||||
for="${data.meta.idp}-traits"
|
||||
for="${id}"
|
||||
>
|
||||
${label}
|
||||
</label>
|
||||
<string-tags
|
||||
id="${data.meta.idp}-traits"
|
||||
id="${id}"
|
||||
value="${input.value}"
|
||||
name="${input.path}"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue