[Rt-commit] rt branch 5.0/search-filter-handle-implicit-submission created. rt-5.0.3-271-gfe7bbb90a2
BPS Git Server
git at git.bestpractical.com
Fri Mar 3 22:09:19 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/search-filter-handle-implicit-submission has been created
at fe7bbb90a21db35d470fddeb56176a8423b297b5 (commit)
- Log -----------------------------------------------------------------
commit fe7bbb90a21db35d470fddeb56176a8423b297b5
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Mar 4 05:34:47 2023 +0800
Handle implicit form submissions in search filter modals
Hitting Return/Enter on text inputs like the "Subject" input implicitly
submits forms. Previously it submitted the filter form, as the form
doesn't contain the complete params and doesn't pre-process params
either, it would submit wrong data, e.g. to filter tickets with Subject
like "foo", no matter what the original query is, the URL was always:
/Search/Results.html?Subject=foo
This commit makes it do exactly the same thing as the "Apply" button.
diff --git a/share/static/js/util.js b/share/static/js/util.js
index f930b7bf03..303769c396 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -958,6 +958,9 @@ jQuery(function() {
jQuery(window).resize(function() {
jQuery('#li-page-actions > ul').css('max-height', jQuery(window).height() - jQuery('#rt-header-container').height());
}).resize();
+
+ // Handle implicit form submissions like hitting Return/Enter on text inputs
+ jQuery('form[name=search-results-filter]').submit(filterSearchResults);
});
function filterSearchResults () {
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list