Bug 29002: Empty select2 options for patron at modal close

Select2's recommended reset doesn't remove <option> blocks it adds for
ajax responses.. as such it gets confused when you subsequently
re-initialise.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2023-10-27 15:23:02 +01:00 committed by Tomas Cohen Arazi
parent f1bb412c77
commit c358f9cc45
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 0 deletions

View File

@ -552,6 +552,7 @@ $("#placeBookingForm").on('submit', function(e) {
$('#placeBookingModal').on('hidden.bs.modal', function (e) {
$('#booking_patron_id').val(null).trigger('change');
$('#booking_patron_id').empty();
$('#booking_item_id').val(0).trigger('change');
$('#period').get(0)._flatpickr.clear();
$('#booking_start_date').val('');