Skip to content

Commit 45590ce

Browse files
authored
[4.x] Prevent terms fieldtype in typehead mode showing results until a search is entered (#9082)
Prevent terms fieldtype in typehead mode showing results until a search is entered
1 parent f2c7b51 commit 45590ce

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Fieldtypes/Terms.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ public function preProcess($data)
216216

217217
public function getIndexItems($request)
218218
{
219+
if ($this->config('mode') == 'typeahead' && ! $request->search) {
220+
return collect();
221+
}
222+
219223
$query = $this->getIndexQuery($request);
220224

221225
if ($sort = $this->getSortColumn($request)) {

0 commit comments

Comments
 (0)