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

Disabling liveSearch does not work #1152

Closed
kelesi opened this issue Feb 4, 2016 · 8 comments
Closed

Disabling liveSearch does not work #1152

kelesi opened this issue Feb 4, 2016 · 8 comments

Comments

@kelesi
Copy link

kelesi commented Feb 4, 2016

In v2.25.3 setting "filter_liveSearch : false" does not disable liveSearch. It was working in v2.23.5.

@kelesi
Copy link
Author

kelesi commented Feb 4, 2016

Seems like the issue is in

.bind( 'search change keypress '.split( ' ' ).join( namespace + ' ' ), function( event )

where this condition

if ( wo.filter_initialized && ( event.which === 13 || event.type === 'search' ||
    event.type === 'change' && this.value !== c.lastSearch[column] ) ) {

has been changed to this

if ( wo.filter_initialized && ( event.which === tskeyCodes.enter || event.type === 'search' ||
    // only "input" event fires in MS Edge when clicking the "x" to clear the search
   ( event.type === 'change' || event.type === 'input' ) && this.value !== c.lastSearch[column] ) ) {

When removing the added condition

event.type === 'input'

the disabling of liveSearch works.

Or replacing it with

( event.type === 'change' || (event.type === 'input' && wo.filter_liveSearch === true))

I am not sure why the event.type === 'input' condition has been added to the function, so I am not sure what is the correct way for fixing this.

@Mottie
Copy link
Owner

Mottie commented Feb 4, 2016

Hi @kelesi!

I'm looking into this now. Thanks for reporting the issue and doing some troubleshooting!

@Mottie
Copy link
Owner

Mottie commented Feb 4, 2016

Ok, I have a fix available in the master branch... I was trying to write a unit test, but sadly I've run out of time for messing around this morning 😉

@Mottie
Copy link
Owner

Mottie commented Feb 15, 2016

Version 2.25.4 is now available with this fix!

@kelesi
Copy link
Author

kelesi commented Oct 5, 2016

Hi @Mottie,
Seems like disabling live search does not work again since v2.27.7.

@Mottie
Copy link
Owner

Mottie commented Nov 4, 2016

Hi @kelesi!

Sorry for the delay in responding, I've just returned from a much needed extended vacation.

It appears that the liveSearch setting was bypassed when an "input" event listener was included to fix issue #1280. I'll need to figure out the best way to deal with this new issue... either ignore the "input" event when the filter_liveSearch option is false, or check for a mobile device and only include in that case.

@Mottie
Copy link
Owner

Mottie commented May 24, 2017

Setting the liveSearch to false was fixed in v2.28.11. Please let me know if you encounter any issues with the changes.

@Mottie
Copy link
Owner

Mottie commented Sep 28, 2017

I'm guessing this issue has been resolved, so I'm going to close it. If you continue to have problems, please feel free to continue the discussion in this thread.

@Mottie Mottie closed this as completed Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants