#Schezwann

1 messages · Page 1 of 1 (latest)

hexed jayBOT
mortal spruce
versed radish
#

the readOnly option doesn't change the Payment Element's visual appearance as it does not apply the disabled attribute

mortal spruce
versed radish
#

I've already read those pages but I still don't see how to set the inputs in a disabled state

mortal spruce
#

I don't think you'll set disabled. Instead you set the Payment Element to read only and then use the Appearance API to change the appearance of the element to match the appearance of your disabled fields.

versed radish
#

But the inputs already have a dedicated :disabled style

#

can't I update the inputs classes either ?

mortal spruce
#

I'm not sure I understand what you're referring to, can you elaborate or show me?

versed radish
#

If i manually add a disabled attribut to the card number input via my browser devtools I can see that the CSS have a custom :disabled state that does exactly what I want to do

#

This style seems to also be accessible via a class

#

Do I really need to change the appearance of the whole element when I could just disabled the input or add the 'p-Input--disabled' class to it ?

mortal spruce
#

Can you add disabled to the Element? What happens when you try to do so?

versed radish
#

According to your documentation the disabled option isn't available for the Payment Element

mortal spruce
#

So you can't set it directly?

versed radish
#

I get the following error when trying to set the disabled option on a Payment Element

#

paymentElement.update({ disabled: true });

#

Unrecognized payment.update() parameter: disabled is not a recognized parameter. This may cause issues with your integration in the future.

mortal spruce
#

Gotcha, so sounds like we're back to setting readOnly and using the Appearance API to change the appearance of the Element.

hexed jayBOT