lorenzofox3 / Smart-Table

Code source of Smart Table module: a table/grid for Angularjs
http://lorenzofox3.github.io/smart-table-website/
1.8k stars 513 forks source link

Last space trim when typing fast #779

Closed FreeFrags closed 6 years ago

FreeFrags commented 7 years ago

Hi,

I found that even with the samples on your website if you type fast and the last char is a space it will get trimmed.

I found: "don't trim when I'm writing" fix #656

But this either fixes something similar or it didnt fix the issue

lorenzofox3 commented 7 years ago

The problem is that trimming was requested earlier https://github.com/lorenzofox3/Smart-Table/issues/284 as it was the standard of angular filter filter. I think you can avoid the trimming while typing by increasing the debounce time of the directive

FreeFrags commented 7 years ago

debounce? you mean the st-delay?

i think it might be nice to make this a optional feature because if i now pause at a space i will have to reenter the space. i understand that this is annoying if you copy paste. but if you enter a string with a space even with copy pasting it should search for what you asked for :)

lorenzofox3 commented 7 years ago

debounce? you mean the st-delay?

yes

True, I think we have to find a compromise here. An optional flag could be an option

FreeFrags commented 7 years ago

Any chance you could add this, i'm not fully familiar to the code of the control yet. If not i will try to fix it and make a PR.

lorenzofox3 commented 7 years ago

sorry quite busy at the moment ... :( better if it comes from the community

FreeFrags commented 6 years ago

I created a pull request, hopefully you can merge this

FreeFrags commented 6 years ago

Fixed the test to include this option too