Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Taitava opened this issue Aug 3, 2018 · 0 comments

Comments

@Taitava
Copy link
Contributor

Taitava commented Aug 3, 2018

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 Taitava changed the title SS3: BetterButtonCustomAction::performDisabledTransformation() does not diable the button SS3: BetterButtonCustomAction::performDisabledTransformation() does not disable the button Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant