Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent rubber-banding in Telemetry Table filter input #7248

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/plugins/telemetryTable/components/TableComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export default {
}
},
created() {
this.filterChanged = _.debounce(this.filterChanged, 500);
this.filterTelemetry = _.debounce(this.filterTelemetry, 500);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make a pretty neat composable if you're looking to get your hands dirty. Something like useDebounceFn maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted!

},
mounted() {
this.csvExporter = new CSVExporter();
Expand Down Expand Up @@ -667,8 +667,7 @@ export default {
this.headersHolderEl.scrollLeft = this.scrollable.scrollLeft;
}
},
filterChanged(columnKey, newFilterValue) {
this.filters[columnKey] = newFilterValue;
filterTelemetry(columnKey) {
if (this.enableRegexSearch[columnKey]) {
if (this.isCompleteRegex(this.filters[columnKey])) {
this.table.tableRows.setColumnRegexFilter(
Expand All @@ -684,6 +683,10 @@ export default {

this.setHeight();
},
filterChanged(columnKey, newFilterValue) {
this.filters[columnKey] = newFilterValue;
this.filterTelemetry(columnKey);
},
clearFilter(columnKey) {
this.filters[columnKey] = '';
this.table.tableRows.setColumnFilter(columnKey, '');
Expand Down