Need to support a disabled state which is set via ->setDisabled(true)
This is similar though not quite the same as ->setReadonly() which had supported on this card
For example, with very quick test locally shows that there is a mouse pointer with the readonly field, though there isn't one with the disabled field
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->insertAfter('Content', new TextField('MyText01'));
$fields->insertAfter('Content', (new TextField('MyText02'))->setReadonly(true));
$fields->insertAfter('Content', (new TextField('MyText03'))->setDisabled(true));
return $fields;
}
Some differences between readonly and disabled can be found here
Acceptance criteria
When setDisabled is set to true, the field renders with the read only styles and the user can not update the value.
There's a follow up card to block any updates in the backend for readonly/disabled field.
Notes
We discussed whether disabled or readonly should have any practical difference. We concluded it wasn't really worth treating them as separate use cases.
Need to support a disabled state which is set via
->setDisabled(true)
This is similar though not quite the same as
->setReadonly()
which had supported on this cardFor example, with very quick test locally shows that there is a mouse pointer with the readonly field, though there isn't one with the disabled field
Some differences between readonly and disabled can be found here
Acceptance criteria
setDisabled
is set totrue
, the field renders with the read only styles and the user can not update the value.Notes
PR