This is heavily related to the issue reported by Berdir here: https://www.drupal.org/node/2857051
I think the same (or almost the same) issue is occurring with the PaymentGatewayForm element, which itself embeds ProfileSelect elements and other dynamic fields.
When testing changes to the ProfileSelect element, it behaves properly in the context of Shipping Information, but the form values seem to refresh an extra time with default values again when in the context of a payment gateway form.
After bringing up in Slack, bojanz suggested that the payment gateway form should extend RenderElement instead of FormElement, just like the related issue did for the ProfileSelect element.
A PR is in the works for testing and review. Verifying that it resolves my issue first, and will have it posted shortly if it seems to work.
Comments
Comment #2
replicaobscuraComment #3
replicaobscuraPR submitted, seems to fix the issue for me without doing anything further.
https://github.com/drupalcommerce/commerce/pull/724
Comment #4
replicaobscuraComment #5
replicaobscuraComment #6
replicaobscuraComment #7
bojanz commentedMakes sense, IEF itself extends RenderElement, that's where we got it from. Merged.
Thanks!