public function getBetterButtonsActions()
{
$fields = parent::getBetterButtonsActions();
$my_action = BetterButtonCustomAction::create('MyAction', 'My Action');
$my_action = $my_action->performDisabledTransformation();
$fields->push($my_action);
return $fields;
}
The button appears to be still clickable. The reason is simply because the button is an <a> element in the editor's HTML code. It does have an attribute disabled="disabled" but obviously HTML does not support that for <a> elements.
Could it be simply fixed by making the href attribute empty if the field has the $disabled property set to true?
I haven't tried this in SilverStripe 4. If it works in SS 4, then I guess it's not meaningful to spend much time fixing this in SS 3.
Example code:
The button appears to be still clickable. The reason is simply because the button is an
<a>
element in the editor's HTML code. It does have an attributedisabled="disabled"
but obviously HTML does not support that for<a>
elements.Could it be simply fixed by making the
href
attribute empty if the field has the$disabled
property set to true?I haven't tried this in SilverStripe 4. If it works in SS 4, then I guess it's not meaningful to spend much time fixing this in SS 3.