# Web Payments SDK bug?

**URL:** <https://developer.squareup.com/forums/t/web-payments-sdk-bug/3202>\
**Category:** Questions\
**Tags:** payment-form\
**Created:** [August 12, 2021, 5:27am UTC](https://developer.squareup.com/forums/t/web-payments-sdk-bug/3202 "2021-08-12T05:27:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/simon/32/705_2.png) [@simon](https://developer.squareup.com/forums/u/simon)\
**Post date:** [August 12, 2021, 5:27am UTC](https://developer.squareup.com/forums/t/web-payments-sdk-bug/3202/1 "2021-08-12T05:27:39Z")

</div>

When rendering the Web Payments SDK in a hidden element the payment form comes out at approx double height.

Any suggestions on correcting this?

Screen shot of simple example rendered in a hidden element (display:none).

 ![Screen Shot 2021-08-12 at 3.25.19 pm](https://global.discourse-cdn.com/square/original/1X/fc5c786b91c68484ac74ec6d6827f48abed320e5.png)

---

<div class="post-metadata">

**Author:** ![amanning](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@amanning](https://developer.squareup.com/forums/u/amanning)\
**Post date:** [August 12, 2021, 4:14pm UTC](https://developer.squareup.com/forums/t/web-payments-sdk-bug/3202/2 "2021-08-12T16:14:46Z")

</div>

Hey!

You can use `card.recalculateSize` to fix this issue:

> **[Card Object - Square Web Payments SDK Reference](https://developer.squareup.com/reference/sdks/web/payments/objects/Card#Card.recalculateSize)**
>
> The credit or debit card payment method\\n\\nAn object that has the methods to create and set up a single card payment.\\nCreated by \`payments.card()\`.

---

<div class="post-metadata">

**Author:** ![simon](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/simon/32/705_2.png) [@simon](https://developer.squareup.com/forums/u/simon)\
**Post date:** [August 13, 2021, 1:06am UTC](https://developer.squareup.com/forums/t/web-payments-sdk-bug/3202/3 "2021-08-13T01:06:34Z")

</div>

Thanks that works nicely 🙂

---

<div class="post-metadata">

**Author:** ![harleen](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@harleen](https://developer.squareup.com/forums/u/harleen)\
**Post date:** [March 1, 2024, 6:18am UTC](https://developer.squareup.com/forums/t/web-payments-sdk-bug/3202/4 "2024-03-01T06:18:55Z")

</div>

> [@amanning](#):
>
> recalculateSize

I am using angular 15, recalculateSize is not working. I am using angular detectChanges function also.
