Skip to content

Inputfield header dropdown action should be active by default #2170

@Toutouwai

Description

@Toutouwai

I attempted to add an inputfield header dropdown action like this...

$inputfield->addHeaderAction([
	'icon' => 'inbox',
	'menuItems' => [
		[
			'label' => 'Create sandbox copy of this page',
			'href' => "/processwire/page/flora-sandbox/create/?id=$page->id",
			'target' => '_blank',
		],
	],
]);

...and was confused when the action was greyed-out and disabled.

It turns out I have to set 'active' => true to avoid this, but shouldn't actions be enabled by default? I would think that if you're adding an action you want it to do something unless you are specifically disabling it for some reason.

Related: please see my request for allowing the target attribute for header actions that are not in a dropdown, as it's not ideal to create a dropdown with a single menu item when adding the link to the action icon itself would be more direct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions