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(); }); }