Skip to content

Commit 93675dc

Browse files
BastianLedererIcinganilmerg
authored andcommitted
SearchEditor: Show no placeholders if suggestionUrl is null
When no suggestions are available the placeholders are misleading
1 parent 95c572e commit 93675dc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Control/SearchEditor.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@ protected function createCondition(Filter\Condition $condition, $identifier)
493493
'data-type' => 'column',
494494
'data-enrichment-type' => 'completion',
495495
'data-term-suggestions' => '#search-editor-suggestions',
496-
'placeholder' => $this->translate('Start typing to search for a column')
496+
'placeholder' => $this->getSuggestionUrl() !== null
497+
? $this->translate('Start typing to search for a column')
498+
: null
497499
]);
498500
$columnInput->getAttributes()->registerAttributeCallback('data-suggest-url', function () {
499501
return (string) $this->getSuggestionUrl();
@@ -571,7 +573,9 @@ protected function createCondition(Filter\Condition $condition, $identifier)
571573
'data-type' => 'value',
572574
'data-enrichment-type' => 'completion',
573575
'data-term-suggestions' => '#search-editor-suggestions',
574-
'placeholder' => $this->translate('Start typing to search for a value')
576+
'placeholder' => $this->getSuggestionUrl() !== null
577+
? $this->translate('Start typing to search for a value')
578+
: null
575579
]);
576580
$valueInput->getAttributes()->registerAttributeCallback('data-suggest-url', function () {
577581
return (string) $this->getSuggestionUrl();

0 commit comments

Comments
 (0)