Problem/Motivation
When you try to make a conditional field (eg: display an input) based on currently selected transition the field doesn't appear. This is bacouse the webform use the input name in the condition and in the rendered form this name is duplicated.
Condition in the source YML:
'#states':
visible:
':input[name="workflow[transition]"]':
value: switch
Where the "workflow" is the key for the workflow element.
Rendered Form:
<input data-drupal-selector="edit-workflow-transition" type="hidden" name="workflow[transition]" value="">
and
<select class="workflow-transition form-select" data-drupal-selector="edit-workflow-transition" aria-describedby="edit-workflow-transition--2--description" id="edit-workflow-transition--2" name="workflow[transition]"><option value="" selected="selected">- select transition -</option><option value="switch">Switch</option><option value="switch_2">Switch 2</option></select>
The hidden input stores the last saved transition in the value and the the select is the currently selected transition. If you make your condition in webform way, and refers to the field with the name attribute the hidden value will brake this condition.
Steps to reproduce
1) Make a workflow with at least 1 transition.
2) Select this workflow in the "Webform workflows element".
3) Create a new field with the condition above and set the value to your transition.
4) In the form select the transition and nothing happens