From c5492ff8df35426f2b9a8d2c38dd903d3a77077b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Gla=CC=88ser?= Date: Thu, 4 Jun 2026 18:33:28 +0200 Subject: [PATCH] Switch large table search to submit --- components/data-display.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/data-display.html b/components/data-display.html index 410ddd3..77edaa2 100644 --- a/components/data-display.html +++ b/components/data-display.html @@ -80,7 +80,7 @@
Large Table
- +
- +
@@ -224,6 +224,7 @@ const searchInput = table.querySelector('[data-large-table-search]'); const searchFieldWrap = table.querySelector('[data-component="single-line-input"]'); const searchClearButton = table.querySelector('.sg-input-clear-button'); + const searchForm = table.querySelector('[data-large-table-search-form]'); const state = { columnIndex: 0, direction: 'ascending', @@ -316,10 +317,16 @@ if (searchInput) { searchInput.addEventListener('input', () => { - state.query = searchInput.value.trim().toLowerCase(); if (searchFieldWrap) { searchFieldWrap.setAttribute('data-has-value', searchInput.value ? 'true' : 'false'); } + }); + } + + if (searchForm && searchInput) { + searchForm.addEventListener('submit', (event) => { + event.preventDefault(); + state.query = searchInput.value.trim().toLowerCase(); renderRows(); }); }