Skip to content

Commit 4a7aa73

Browse files
authored
Merge pull request #4724 from Laravel-Backpack/fix-scrollbar-on-select2
Remove width 100% and add to input
2 parents f1c257e + c5b3ead commit 4a7aa73

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/resources/views/crud/inc/show_tabbed_fields.blade.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
<ul class="nav {{ $horizontalTabs ? 'nav-tabs' : 'flex-column nav-pills'}} {{ $horizontalTabs ? '' : 'col-md-3' }}" role="tablist">
3232
@foreach ($crud->getTabs() as $k => $tab)
3333
<li role="presentation" class="nav-item">
34-
<a href="#tab_{{ Str::slug($tab) }}"
35-
aria-controls="tab_{{ Str::slug($tab) }}"
36-
role="tab"
37-
tab_name="{{ Str::slug($tab) }}"
38-
data-toggle="tab"
34+
<a href="#tab_{{ Str::slug($tab) }}"
35+
aria-controls="tab_{{ Str::slug($tab) }}"
36+
role="tab"
37+
tab_name="{{ Str::slug($tab) }}"
38+
data-toggle="tab"
3939
class="nav-link {{ isset($tabWithError) && $tabWithError ? ($tab == $tabWithError ? 'active' : '') : ($k == 0 ? 'active' : '') }}"
4040
>{{ $tab }}</a>
4141
</li>
@@ -72,15 +72,13 @@ class="nav-link {{ isset($tabWithError) && $tabWithError ? ($tab == $tabWithErro
7272
margin-top: 0;
7373
}
7474
75-
/*
75+
/*
7676
when select2 is multiple and it's not on the first displayed tab the placeholder would
7777
not display correctly because the element was not "visible" on the page (hidden by tab)
7878
thus getting `0px` width. This makes sure that the placeholder element is always 100% width
7979
by preventing the select2 inline style (0px) from applying using !important
8080
*/
81-
.select2-container,
82-
.select2-container li:only-child,
83-
.select2-container input:placeholder-shown {
81+
.select2-search__field {
8482
width: 100% !important;
8583
}
8684
</style>

0 commit comments

Comments
 (0)