xaksis / vue-good-table

An easy to use powerful data table for vuejs with advanced customizations including sorting, column filtering, pagination, grouping etc
https://xaksis.github.io/vue-good-table/
MIT License
2.16k stars 405 forks source link

Column Filter overwrites filter value during loading #921

Open TheJaredWilcurt opened 2 years ago

TheJaredWilcurt commented 2 years ago

Issue Type

Specs

Expected Behavior

The text you type into the column filter remains as typed

Actual Behavior

Some characters get overwritten as you type

Steps to Reproduce the Problem

  1. Reproduction link: https://jsfiddle.net/p7n4fsy2/2
  2. Type into the filter john
  3. The speed at which you type affects if the bug occurs, it may take several attempts
  4. This seems to only occur in "remote" mode

921

NOTE: Backspace is not being typed, the h is removed by VGT. Or more accurately "joh" is replaced with "jo" (after the first search finishes) but the user is still typing (so the n is appended, making jon). This can be any character in the string that is being typed, or multiple characters.

abliGhtS commented 1 year ago

I localized the updateFilters method as a potential source of an issue. Inside the method, there's a 400ms delay from setTimeout, which seems to be causing a race condition. Removing setTimeout seems to be fixing the issue but there must have been a reason for the usage so I'm not sure if simply removing it, won't cause more issues.

Any input from contributors?