searchbuilder button, conditions broken with bootstrap 5 on safari

searchbuilder button, conditions broken with bootstrap 5 on safari

mrsman2mrsman2 Posts: 7Questions: 3Answers: 0

Link to test case: https://codepen.io/ddmee/pen/MWmEGPx
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

  • SearchBuilder does not retain conditions correctly when using it with bootstrap 5 on safari.
  • Safari (desktop) browser version: Version 14.1.1 (16611.2.7.1.4)

The link to the test case shows a codepen that shows the issue.

Steps to recreate the bug:

Pictures of each step on my browser: https://imgur.com/gallery/Phuqox6

  1. visit the code on safari desktop browser (have not tested on mobile).
  2. click the 'Search Builder' button.
  3. add a filter (condition). IMPORTANT: set the condition to be something other than the Equals condition. E.g. set it to Not. (For example add a single condition - data=position, condition=not, value=accountant
  4. click away from the search builder pane, so the filters are hidden and the user is viewing the filtered table.
  5. Now click on the 'Search Builder' button again, to bring back the filters. You should now see the bug. The condition reverts to 'Equals' rather than 'Not' or any other value. For example, the filter will be showing: data=position, condition=Equals, value=accountant.
  6. If you try to add any extra filters, the condition is stuck on Equals.

I have tested this on Chrome and the issue does not occur. So I am not sure whether the bug is with Safari rather than DataTables or perhaps the bug is somewhere else. I'm not sure.

Answers

  • sandysandy Posts: 705Questions: 0Answers: 192

    Hi @mrsman2 ,

    Thanks for pointing this out to us. We don't currently have any apple devices to hand, but allan does have one at home. We will take a look at this when we get an opportunity. I've raised an issue internally (DD-2045 for my reference) and will report back here when there is an update.

    Thanks,
    Sandy

  • sandysandy Posts: 705Questions: 0Answers: 192

    Hi @mrsman2 ,

    Thanks for waiting while we made a fix. That should be the issue fixed now as you can see at your updated example.

    This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • mrsman2mrsman2 Posts: 7Questions: 3Answers: 0

    Hi @sandy

    Thanks for fixing it! Yeah it looks fixed from that codepen. Though that code-pen is running really slow in my browser. But I assume that's unrelated.

    I'll wait until the next release. It's a bit awkward for me to take the nightly I think. As I currently load in the DataTable code like so:

        <script type="text/javascript" src="https://cdn.datatables.net/v/bs5/dt-1.10.25/b-1.7.1/date-1.1.0/sb-1.1.0/datatables.min.js"></script>
    

    I don't know if I can just stick in an element in after that to take the nightly?

        <script type="text/javascript" src="https://cdn.datatables.net/v/bs5/dt-1.10.25/b-1.7.1/date-1.1.0/datatables.min.js"></script>
        <script type="text/javascript" src="https://nightly.datatables.net/searchbuilder/js/dataTables.searchBuilder.js"></script>
    

    Thanks again.

  • kthorngrenkthorngren Posts: 14,086Questions: 25Answers: 3,322

    Open the https://cdn.datatables.net/v/bs5/dt-1.10.25/b-1.7.1/date-1.1.0/sb-1.1.0/datatables.min.js link. Inside you will find a link to update the extensions. You can remove SearchBuilder and use the updated concatenated CDN along with the nightly. Then later update again using the same technique when the new version is posted.

    Kevin

Sign In or Register to comment.