Closed (won't fix)
Project:
Drupal core
Version:
9.1.x-dev
Component:
theme system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 May 2019 at 12:24 UTC
Updated:
10 Jun 2020 at 17:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
quironI guess something similar to what is done in actions when https://www.drupal.org/project/drupal/issues/2855458 is done will work here. If is ok maybe we should look for a better location for the shared code between both methods.
Comment #3
lauriiiComment #4
wim leers#type ⇒ 'button'uses!🤔 I think this took inspiration from
\Drupal\Core\Render\Element\Actions::preRenderActionsDropbutton(). Let's add an@seeto ensure that we keep them in sync.🤔 Why do we even need to keep the original?
Comment #6
huzookaRe #2:
How can a Button element have child elements? (I think that it cant have at all).
The only place where core tries to hack
<input type="submit"/>s in a Dropbutton is the ViewsEditForm (I referenced that in the issue summary), and I'm using that for testing our options and even this patch.The hack starts there at line 403 and ends at line 511. If you check the code, you will see that the
pathkey is a link and not an input submit. So the ideal Dropbutton must be able to render links, Buttons and Submit elements, even mixed.And even contrib modules do that (at least Paragraphs does that, see #3079128: Broken Dropdown prevents Save in Claro).
Since Dropbutton uses the links theme function, these are hacks now, and this kind of hacks are not acceptable imho.
Comment #7
lauriiiComment #9
bnjmnmThe Splitbutton element will be capable of this, and is nearing completion in #1899236: Add new Splitbutton render element to eventually replace Dropbutton. It will be very easy to change dropbuttons to splitbuttons.
As @huzooka already stated in #6, making this possible in a dropbutton would either require something quite hacky or a major API change that is far more complex than simply changing to Splitbutton once available.
Comment #10
damienmckennaThank you so much for the update!