silverstripe-gridfield-betterbuttons icon indicating copy to clipboard operation
silverstripe-gridfield-betterbuttons copied to clipboard

SS3: BetterButtonCustomAction::performDisabledTransformation() does not disable the button

Open Taitava opened this issue 7 years ago • 0 comments

Example code:

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.

Taitava avatar Aug 03 '18 19:08 Taitava