Problem/Motivation
See #3281151: Remove extra margin on 'add paragraph' button on claro, the class is added to the button element, if modules like paragraphs are doing something arguably weird, button might not actually be a button.
It would IMHO be better if \Drupal\Core\Field\WidgetBase::formMultipleElements() would already set that button class instead of claro adding it itself, then other themes don't have to duplicate that.
Possible problems:
* Is it an API change to move a class like that? Nothing will change for any widget that does not replace the button, but for widgets that do, it will change back to a large button.
Steps to reproduce
Proposed resolution
Remaining tasks
* Create the patch to move that class from claro_preprocess_field_multiple_value_form() to the widget
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3292488
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3292488-move-button--small-class
changes, plain diff MR !5815
Comments
Comment #2
berdirComment #3
romina_ferrario commentedmove class button-small from claro_preprocess_field_multiple_value_form() to the widget
Comment #4
rymcveighJust noting that the patch supplied in #3 will not apply when I attempt to apply it to Drupal version 9.4.5 via composer.
Comment #6
gaurav-mathur commentedComment #7
gaurav-mathur commentedI apply patch #3 and it is work fine in claro.
Comment #8
smustgrave commentedThis looks like a good change and not breaking anything.
Also verified still applies to 10.1.x also.
Comment #10
smustgrave commentedMoving back as appears to be random failure for 9.5
Comment #13
berdirRandom test fail again I think.
Comment #14
lauriiiI think we could use the
#button_typerender array key instead. With that this would be just a render array change which is acceptable in a minor.Comment #15
_utsavsharma commentedTried to address the pointer in #14.
Comment #18
prashant.cAdded
'#button_type' => 'small', kept the attributesRaised a MR, changes needs to be reviewed.
Thanks!
Comment #19
smustgrave commentedSeems the change at line 281 is out of scope. And issue summary mentions screenshots of a multi value widget which should be added to the user interface section of the summary
Comment #20
berdirThere is no change in core *if* you use Claro, we just move the class. Other themes that currently don't override it like that might change though. I suppose we could compare the backend with another theme, but not even sure which one?
Comment #21
primsi commentedPatch for composer projects.
Comment #22
berdirRemoving seven as I think that's no longer a concern. Gin extends from claro, so it inherits this, so nothing should change there either.
Comment #23
smustgrave commentedHiding old patches.
Tested by adding an unlimited text field to a random content type. The "Add another item" button remained unchanged by the MR so no regression.
Comment #27
nod_Committed abcb202 and pushed to 11.x. Thanks!