#Desa

1 messages · Page 1 of 1 (latest)

left condorBOT
weak wave
#

Hi there, so you want to control the order of payment options in PaymentElement, am I right?

violet dew
#

Basically, yes. I am able to set the proper order, but the wrong one seems to always be selected still, even with a properly set 'new' order.

violet dew
#

Yes, and that part is working. But the first item in the order doesn't seem to be the one that is always selected, so the order is being set, but the 'original' selected item always is stays selected, just like in the example here"
Prev order: (selected) Card, Bank Account.
New order: Bank Account, (Selected) Card.
Anticipated: (selected) Bank account, Card.

#

I basically just need to guarantee that the first item in the array is the selected/active one when the priorityPaymentType changes. (which it is already listening for and updating, just the 0(first) array item is not being selected.

weak wave
#

I don't quite get the problem, is there a webpage that I can visit to see the problem myself?

violet dew
#

It's not live, but I can record a gif?

#

Does that work?

weak wave
#

Sure, that work for me

violet dew
#

You can see the order updates - but not the 'selected' item

weak wave
#

Ok, so the expectation is that the card should be selected, am I right?

violet dew
#

in this example - yes.

#

I tried putting a key on it to make it rerender, but since it's an iframe, i don't think it's actually doing anything.

weak wave
#

OK, do you still see this problem if you set a static paymentMethodOrder ?

violet dew
#

No- because on init it is the first item in the array. but by making it dynamic, the selected item seems to persist through the array being different.

weak wave
#

Ok. I can feed back this to the development team. Thanks for letting me know about this use case.

violet dew
#

There's no way to control the 'selected' element? I can even pass it the exact type - i just want to be able to set it with JS if needed vs a user action in some cases

weak wave
#

No, I don't see an option to make a payment option selected at this moment.