fix(viewer): use ghost span in grid stack to enforce column name width
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -72,11 +72,18 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
th.appendChild(select);
|
||||
}
|
||||
} else if (colName) {
|
||||
const wrap = document.createElement("div");
|
||||
wrap.className = "col-filter-wrap";
|
||||
|
||||
const ghost = document.createElement("span");
|
||||
ghost.className = "col-filter-ghost";
|
||||
ghost.setAttribute("aria-hidden", "true");
|
||||
ghost.textContent = colName;
|
||||
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.className = "col-filter col-filter-text";
|
||||
input.placeholder = colName;
|
||||
input.size = colName.length + 2;
|
||||
input.setAttribute("aria-label", "filter " + colName);
|
||||
let debounceTimer;
|
||||
input.addEventListener("input", () => {
|
||||
@@ -86,8 +93,11 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
applyFilters();
|
||||
}, 300);
|
||||
});
|
||||
|
||||
wrap.appendChild(ghost);
|
||||
wrap.appendChild(input);
|
||||
th.textContent = "";
|
||||
th.appendChild(input);
|
||||
th.appendChild(wrap);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user