FIX remove placeholder search text on readonly field#11419
FIX remove placeholder search text on readonly field#11419andrewandante wants to merge 2 commits intosilverstripe:5from
Conversation
| return $emptyString; | ||
| } | ||
| } | ||
| $name = $this->getName(); |
There was a problem hiding this comment.
Looks like this isn't used below, which I assume is why you've removed it? Please add a note in future when making changes like this so it's easier to know what's going on.
It's obvious in your IDE because it presumably gets greyed out, but seeing why a change like this was made in a git diff requires more double checking.
| $field->setReadonly(true); | ||
|
|
||
| // Remove the text "Type to search..." on a read-only field | ||
| $this->setUseDynamicPlaceholder(false); |
There was a problem hiding this comment.
| $this->setUseDynamicPlaceholder(false); | |
| $field->setUseDynamicPlaceholder(false); |
Shouldn't this be called on the field we're returning?
There was a problem hiding this comment.
Yep, it should. I suspect it won't work because we are now using a different field type, so I'm going to keep playing with this 'til my test passes 🤔
5835657 to
30049dd
Compare
30049dd to
b5203fd
Compare
|
@andrewandante Let me know when this is ready to review and I'll take another look |
|
Thanks - I asked for reproduction steps in the attached issue, I suspect this may also be coming from the React component actually. |
Description
Sets the placeholder text to an empty string on a readonly, "searchable" dropdown.
Also removes a line that sets a
$namevariable as it is unused in the methodIssues
Pull request checklist