erosson / ch2plan

Clicker Heroes 2 skill tree planner
https://ch2.erosson.org
GNU General Public License v3.0
4 stars 3 forks source link

search box lags and skips input #31

Closed erosson closed 6 years ago

erosson commented 6 years ago

seems like it takes the url changes a moment to register, and if I type a character before it registers, that char is overwritten - feeling like the searchbox skips characters unless I type very slowly.

I haven't heard anyone else complain about this, maybe it's linux-only?

jaggerid commented 6 years ago

it does this on chrome windows too, is updating to url important for the search?

erosson commented 6 years ago

Thanks for verifying!

It's important that you can link to a search, but the url change doesn't have to be instant. Fix will likely be to delay the url change until the user stops typing.

erosson commented 6 years ago

Biggest problem here was that I needlessly recomputed the slow shortest-path-between-all-nodes code (#2) whenever you typed a letter. Search generates much less lag after that fix, but with fast enough typing it still skipped letters once in a while, so also added the url change delay.