- 🇦🇺Australia dpi Perth, Australia
Seems to me like there might be a lot of crossover between this and 🐛 Fields with unlimited cardinality show 1 extra input field Needs work
Maybe both should be triaged into a _Optimising add more button behavior_ issue
- last update
11 months ago Patch Failed to Apply - last update
11 months ago 29,682 pass, 9 fail - Status changed to Needs review
10 months ago 10:31am 9 February 2024 - Status changed to Postponed: needs info
10 months ago 3:28pm 9 February 2024 - 🇺🇸United States smustgrave
Moving to PNMI if anyone can confirm #35 is a duplicate, then this can be closed.
If not a duplicate it should move to NW for test coverage and issue summary update.
- Status changed to Needs work
8 months ago 3:01pm 26 March 2024 - 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7
This is still missing "Add More" button.
Also, not a duplicate of related issue.
- 🇧🇪Belgium p-neyens
Here a patch for D10.2.5 with a fix for "Warning: Undefined array key "#delta" in Drupal\Core\Field\WidgetBase::addMoreAjax() (regel 340 van /var/www/html/core/lib/Drupal/Core/Field/WidgetBase.php)"
- 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7
Updated the MR, added a widget option to opt-in
- Assigned to Akhil Babu
- Issue was unassigned.
- Status changed to Needs review
3 months ago 11:36am 13 August 2024 - Status changed to Needs work
3 months ago 12:01pm 13 August 2024 - Status changed to Needs review
3 months ago 3:08pm 13 August 2024 - 🇦🇺Australia pameeela
Gave this a manual test and it looks good. Updated one of the screenshots in the IS which was taken using Gin rather than Claro.
I think these two tags can now be removed too, I reviewed the IS and made some minor tweaks. This would be good to include as a highlight in whatever minor version it makes it into :)
- 🇮🇳India Akhil Babu Chengannur
akhil babu → changed the visibility of the branch 1156338-fixed-maximum-number to hidden.
- 🇮🇳India Akhil Babu Chengannur
akhil babu → changed the visibility of the branch 1156338-fixed-maximum-number to active.
- 🇮🇳India prashant.c Dharamshala
This feature would be beneficial as currently, we are using the contributed modules like
https://www.drupal.org/project/sam → or https://www.drupal.org/project/field_widget_add_more → to achieve the same.I am attaching the before and after screenshots of the manual review on the local Drupal 11 instance.
However, I have a few points:
- Should not the "Show add more button" be enabled by default in the settings rather than explicitly enabling it?
- Now because the button is introduced to add the items the blank field should not be displayed by default without clicking the "Add another item" button.
- On the "Manage form display" page in the widget settings the checkbox label is "Show add more button" but the label of the button is not "Add more" it is "Add another item", which might be confusing to some users.
Thanks!
- 🇦🇺Australia pameeela
@prashant.c thanks for the review, but note there are already screenshots provided there is no need to add more.
Should not the "Show add more button" be enabled by default in the settings rather than explicitly enabling it?
I can see a case for both, as there are definitely situations where you might want the widgets to show. Don't feel strongly either way.
On the "Manage form display" page in the widget settings the checkbox label is "Show add more button" but the label of the button is not "Add more" it is "Add another item", which might be confusing to some users.
I agree the wording could be more clear, but I don't think that saying "Show 'Add another item' button" is the solution because that still isn't that clear. "Simple Add More" module does the opposite of what's in place here: it makes the behaviour the default but offers a setting to show all elements with the wording:
Skip "Simple Add More" simplification (i.e. show all elements, even if empty).
So I think we can also describe better what the setting does, but I'm struggling with something that is both clear and concise: "Show button to add more values instead of maximum empty fields" (too long) / "Show button to add more values" (short but not as obvious) / "Show maximum allowed values even if empty" (not that clear?)
Now because the button is introduced to add the items the blank field should not be displayed by default without clicking the "Add another item" button.
This is a separate issue - 🐛 Fields with unlimited cardinality show 1 extra input field Needs work
- 🇮🇳India prashant.c Dharamshala
Thank you @pameeela for the detailed response. I was not aware of this #2980806: Fields with unlimited cardinality show 1 extra input field.
- 🇦🇺Australia pameeela
After thinking more about this I am leaning toward having it be opt out rather than opt in, because I think it would be more common to want it that not. The reasons to not want it IMO would be if the cardinality is 2 or maybe 3, then I think it probably makes sense to just show the widgets. But in those cases, I don't think it's a problem to have it enabled, and folks could opt out.
The only other consideration is this is a change from the current behaviour that might be unexpected, but I am not sure that is a good reason to have it be opt in.
- 🇮🇩Indonesia el7cosmos 🇮🇩 GMT+7
If we want this by default, do we need to update the existing field config?
It may also make more sense to have "Show all items"/"Show all widgets" instead.
- 🇦🇺Australia pameeela
I don't think we would want to update existing config, changing the behaviour after the fact would be pretty confusing. I think it only should be enabled by default for new config.
So yeah in that case, I think the boolean is off by default, and we can say "Show empty widgets instead of 'Add another item' button" (or something, feedback welcome) for the label. Ideally the label will make it clear what the setting does without being overly long.
But let's wait a bit and see if there is any other input before making changes.
- 🇮🇳India prashant.c Dharamshala
I do not think "Show all items"/"Show all widgets" will make sense because we are not showing all the items at one go, we are providing a way to add another/more item (which is one at a time). So in my opinion "Add another item" is concise and clear to every type of user (technical/non-technical).
Regarding the default enabling option, we may wait for feedback. :)
- Status changed to Needs work
2 months ago 4:14pm 13 September 2024 - 🇺🇸United States smustgrave
Will need some kind of update path for existing sites. If the setting is unchecked add_more: false should be in the config currently it's empty.