Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 305144

Allow for deletion of a single value of a multiple value field

$
0
0

Problem/Motivation

I'm working on creating a custom field that has multiple entry items in the field. The field would look like this
Field 1 - Text
Field 2 - Text
Field 3 - Text

All would be saved into separate columns.

Now my question is with a cardinality of -1 the Add More works great to put the next item to enter but how would one item be removed from the list of them. Ideally a "delete" or "remove" button would be at the end of the item line but I don't see this. I know with a single field emptying the text field "removes" it but this isn't obvious to a use.

It's not unlike the Remove button that appears next to the Image Fields when multiples are allowed.

Is this something available or less of a support request and more of a feature request?

Note: For 7.x there is a contrib module for that: https://www.drupal.org/project/multiple_fields_remove_button
This issue is about adding that functionality to core.

Copied from #93447: Deleting the first value in a required, multivalue field fails validation

Proposed resolution

Use ajax and reload element to remove the item from the page.

Remaining tasks

  • Decide on direction
  • Add tests
  • Review
  • Commit

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 305144

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>