Skip to content

Commit

Permalink
adresses #1224
Browse files Browse the repository at this point in the history
  • Loading branch information
tabacitu committed Aug 20, 2019
1 parent 36123d3 commit fa0dc82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All Notable changes to `Backpack CRUD` will be documented in this file
### Fixed
- fixed #1762 - uploaded have unique file names even if the same file is submitted twice in the same form;
- fixed #1652 - small ```table``` field and ```table``` column bugs when inserting empty last rows;
- adresses #1224 - ```select2_from_array``` with multiple now shows empty option when all are unselected;


## [3.6.27] - 2019-08-17
Expand Down
7 changes: 7 additions & 0 deletions src/resources/views/fields/select2_from_array.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!-- select2 from array -->
@php
echo '<pre>'; var_dump($field); echo '</pre>';
@endphp
<div @include('crud::inc.field_wrapper_attributes') >
<label>{!! $field['label'] !!}</label>
<select
Expand Down Expand Up @@ -71,6 +74,10 @@
{
$(obj).select2({
theme: "bootstrap"
}).on('select2:unselect', function(e) {
if ($(this).attr('multiple') && $(this).val().length == 0) {
$(this).val(null).trigger('change');
}
});
}
});
Expand Down

2 comments on commit fa0dc82

@shadowbane
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've unintentionally added var_dump on select2_from_array @tabacitu

@tabacitu
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I did :-)) Thank you for spotting this @shadowbane . It's long fixed, but I've just gotten to the notification.

Please sign in to comment.