diff --git a/src/views/tableView.js b/src/views/tableView.js index 5536126eb9d12fbc5d1616cc0a8b2d108708d3a5..f352aac4b9a4818780c1f5d18bcb15b4ad5c1211 100644 --- a/src/views/tableView.js +++ b/src/views/tableView.js @@ -46,6 +46,7 @@ export default class TableView { this.tableKeys = keys; this.tileContent = tileContent; this.clickOnRows = clickOnRows; + this.searchValue = ''; } getItemData(data) { @@ -94,7 +95,13 @@ export default class TableView { m(Search, { textfield: { label: 'Search', - onChange: ({ value }) => { controller.debouncedSearch(value); }, + onChange: ({ value }) => { + // this is called not only if the value changes, but also the focus. + // we only want to change the search of the value is changed, therefore we + // have to track changes in the search value + if (value !== this.searchValue) controller.debouncedSearch(value); + this.searchValue = value; + }, }, fullWidth: false, }),