Inspector: Preserve zebra-striping when hiding table rows

Instead of simply setting rows to hidden, add a class so that we can
only include visible rows when applying zebra-striping.
This commit is contained in:
Sam Atkins 2025-02-13 16:05:02 +00:00 committed by Jelle Raaijmakers
parent a10984ea03
commit 37ca2fc25c
Notes: github-actions[bot] 2025-02-17 11:56:46 +00:00
2 changed files with 12 additions and 2 deletions

View file

@ -295,7 +295,11 @@ details > :not(:first-child) {
text-overflow: ellipsis;
}
.property-table tr:nth-child(even) {
.hidden-row {
display: none;
}
.property-table tr:nth-child(even of :not(.hidden-row)) {
background-color: var(--property-table-row);
}

View file

@ -339,7 +339,13 @@ inspector.setStyleSheetSource = (identifier, sourceBase64) => {
const applyPropertyFilter = (row, searchText) => {
const nameMatch = row.cells[0].textContent.toLowerCase().includes(searchText);
const valueMatch = row.cells[1].textContent.toLowerCase().includes(searchText);
row.style.display = nameMatch || valueMatch ? "" : "none";
let matches = nameMatch || valueMatch;
if (matches) {
row.classList.remove("hidden-row");
} else {
row.classList.add("hidden-row");
}
};
const setupPropertyFilter = inputId => {