diff --git a/src/Forms/SearchableDropdownTrait.php b/src/Forms/SearchableDropdownTrait.php index 83a9a0bc13e..4ebc06c31ee 100644 --- a/src/Forms/SearchableDropdownTrait.php +++ b/src/Forms/SearchableDropdownTrait.php @@ -139,7 +139,6 @@ public function getPlaceholder(): string return $emptyString; } } - $name = $this->getName(); if ($this->getUseDynamicPlaceholder()) { if ($this->getIsSearchable()) { if (!$this->getIsLazyLoaded()) { @@ -598,6 +597,9 @@ public function performReadonlyTransformation() $field->setSource($this->sourceList); $field->setReadonly(true); + // Remove the text "Type to search..." on a read-only field + $this->setUseDynamicPlaceholder(false); + return $field; } }