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

"pagerComplete" event does not get executed if filters are unchanged #1631

Closed
larsbonczek opened this issue Feb 22, 2019 · 3 comments
Closed

Comments

@larsbonczek
Copy link
Contributor

larsbonczek commented Feb 22, 2019

When I press enter inside a filter input, the search gets executed even if the filters have not changed.

See here

// immediate search if user presses enter

and here (filter === false here because the event type was 'keypress')
if ( tsf.equalFilters(c, c.lastSearch, currentFilters) && filter !== false ) {
return;

The "filterStart" event gets fired here

c.$table.triggerHandler( 'filterStart', [ filters ] );

but the "pagerComplete" event never gets fired for some reason: (The false means that the "pagerComplete" event shouldn't be fired - but why?)
tsp.updatePageDisplay( c, false );

This causes my loading animation to be displayed on "filterStart", but never to get removed.

EDIT It wasn't the "filterEnd" event that didn't get fired as I first thought but the "pagerComplete" event.

@larsbonczek larsbonczek changed the title "filterEnd" event does not get executed if filters are unchanged "pagerComplete" event does not get executed if filters are unchanged Feb 22, 2019
@Mottie
Copy link
Owner

Mottie commented Mar 20, 2019

Hi @larsbonczek!

Thanks for investigating this problem! I apologize for not responding sooner. I would greatly appreciate a PR with a fix. Maybe prevent setting the filter to false if the last key was an enter? That way line 1366 would stop the flow.

larsbonczek added a commit to larsbonczek/tablesorter that referenced this issue Mar 21, 2019
Fixing Mottie#1631 by not treating the enter key as a key press and thus not executing the search if enter is pressed while no filters were changed.
@larsbonczek
Copy link
Contributor Author

Is it okay if I submit a pull request without having really tested it? I still have my solution from a month ago somewhere, but I don't have time to go back and test it again right now.

larsbonczek added a commit to larsbonczek/tablesorter that referenced this issue May 10, 2019
Fixing Mottie#1631 by not treating the enter key as a key press and thus not executing the search if enter is pressed while no filters were changed.
Mottie pushed a commit that referenced this issue Dec 1, 2019
Fixing #1631 by not treating the enter key as a key press and thus not executing the search if enter is pressed while no filters were changed.
Mottie pushed a commit that referenced this issue Dec 1, 2019
Fixing #1631 by not treating the enter key as a key press and thus not executing the search if enter is pressed while no filters were changed.
@Mottie Mottie closed this as completed Dec 1, 2019
@Mottie
Copy link
Owner

Mottie commented Dec 1, 2019

Thanks again!

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