Skip to content

Commit 2d7c500

Browse files
committed
Fix tag for some browsers
1 parent 9e3b46b commit 2d7c500

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

docs/environment-variables/env-builder.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,28 @@ function renderTags(wrapper, key) {
328328

329329
const container = document.createElement("div");
330330

331-
input.addEventListener("keydown", e => {
332-
if (e.key === "Enter" || e.key === "," || e.key === " ") {
333-
e.preventDefault();
334-
const parts = input.value.split(/[\s,]+/).filter(Boolean);
331+
input.addEventListener("input", () => {
332+
const value = input.value;
333+
334+
if (/[,\s]/.test(value)) {
335+
const parts = value.split(/[,\s]+/).filter(Boolean);
336+
335337
parts.forEach(v => {
336338
if (!tagState[key].includes(v)) {
337339
tagState[key].push(v);
338340
}
339341
});
342+
343+
input.value = "";
344+
renderTagItems(container, key);
345+
updateEnv();
346+
}
347+
});
348+
349+
input.addEventListener("blur", () => {
350+
const value = input.value.trim();
351+
if (value && !tagState[key].includes(value)) {
352+
tagState[key].push(value);
340353
input.value = "";
341354
renderTagItems(container, key);
342355
updateEnv();

0 commit comments

Comments
 (0)