Problem/Motivation
Playing around with the ui and a few composite elements, i noticed that the options dropdown next in the third column, was different depending on which element was listed. After further review of this and looking at the logic for the form, I found that this list was derived dynamically based upon the element's id.
This brought up a few hidden features/issues. Ultimately, the biggest one being that a user can add additional options to the list, but the available values are completely arbitrary, unless you understand how the list is build.
Proposed resolution
Additional information should be added to either the Webforms Options list, or to the element configuration pages in order to indicate how this functionality works. As an alternative, an admin could be given an interface to define these options themselves, which could also make/allow the admin to add options that don't meet the required prefix. A developer is able to add/alter this list by overriding getCompositeElementOptions() in their WebformElement definition.
Screenshot

| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2937109-11.patch | 27.89 KB | jrockowitz |
| #3 | Screen Shot 2018-01-16 at 7.09.28 PM.png | 145.27 KB | jrockowitz |
Comments
Comment #2
richgerdesComment #3
jrockowitz commentedComment #4
jrockowitz commentedBuilding a UI where "an admin could be given an interface to define these options themselves" seems like a lot of work considering admins and developers can just create a custom composite element.
I like adding "additional information should be added to either the Webforms Options list" (/admin/structure/webform/config/options/manage) where we add a column called 'User By' and also display a message when editing the options that says...
The Webform Options that are being dynamically used by Composite elements are...
We also need to see what happens when all the defaults options for a Composite element are deleted. Is there an error or does it default to a plain text field?
Comment #5
jrockowitz commentedComment #11
jrockowitz commentedComment #14
jrockowitz commentedI committed the patch. Please download the latest dev release to review.