Bug in SearchPanes (Bootstrap 4): Filter input is not cleared
Bug in SearchPanes (Bootstrap 4): Filter input is not cleared
pgerundt
Posts: 90Questions: 13Answers: 2
in SearchPanes
Link to test case:
https://datatables.net/extensions/searchpanes/examples/styling/bootstrap4.html
Description of problem:
Type something into "position" input field and click the "x" next to the field. The input is not cleared.
Debugger code:
Input field has classes "dtsp-paneInputButton col-sm form-control search".
This discussion has been closed.
Replies
Additional information:
input field is retrieved by
var searches = _this.dom.container.find('.' + _this.classes.search);
but
_this.classes.search
value iscol-sm form-control search
which results in
var searches = _this.dom.container.find('.col-sm form-control search');
but should be
var searches = _this.dom.container.find('.col-sm.form-control.search');
(replace spaces with dots)
The following lines should also be changed:
And another bug:
Line 1592
var searches = this.dom.container.find(this.classes.search);
should be
var searches = this.dom.container.find('.' + SearchPane.classes.search.split(/\s+/).join('.'));
because
- class names have to be concated with '.' (see above)
- leading dot is missing
-
this.classes.search
contains the original class names whereasSearchPane.classes.search
contains the bootstrap class namesThanks for pointing these out. We'll take a look and report back later in the week,
Colin
Hi @pgerundt ,
The website is using version 1.2.1 of SearchPanes, which is really strange. We are trying to get to the bottom of that.
The issues that you mentioned has already been fixed and will be included in the next SearchPanes release which we hope will be in the next few weeks.. Take a look at this example. Until then you can access the fix from the nightly builds.
Thanks,
Sandy
Hi Sandy,
thank you for this information.
One last recommendation: I would use something like
.replace(/\s+/g, '.'))
or
.split(/\s+/).join('.'))
instead of
.replace(/ /g, '.'))
So if anyone ever messes up with the class options (multiple spaces, tabs instead of spaces), you won't run into another problem.
Thanks a lot,
Pascal
Hi @pgerundt ,
Thanks for pointing this out, I've updated the regexs as you've suggested
Again, this will be available in the nightly builds for now.
Thanks,
Sandy
Hello. What is the best way track when this fix will be included in the next release instead of only available on nightly? Do you have a specific date planned? Thanks!
We tend to make releases every month or two, so it would be worth checking back regularly. You could also download the nightly build and host them locally, as that would give you the consistency of the script.
Colin