From 982ead3b3886557ccbb17058140be3728c1f23fa Mon Sep 17 00:00:00 2001 From: Joshua Dinh <75056371+JoshuaHungDinh@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:22:46 -0800 Subject: [PATCH] Fix: Apply taggedElement to improve iframe height resizing in v3 forms (#7607) --- .../Controllers/BlockRenderController.php | 8 -------- .../resources/app/Components/ModalForm.tsx | 1 + .../Blocks/DonationFormBlock/resources/app/index.tsx | 1 + 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php b/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php index 81462124ff..4279f412fd 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php +++ b/src/DonationForms/Blocks/DonationFormBlock/Controllers/BlockRenderController.php @@ -104,14 +104,6 @@ private function getFormViewUrl(DonationForm $donationForm): string */ protected function loadEmbedScript() { - (new EnqueueScript( - 'givewp-donation-form-embed', - 'build/donationFormEmbed.js', - GIVE_PLUGIN_DIR, - GIVE_PLUGIN_URL, - 'give' - ))->loadInFooter()->enqueue(); - (new EnqueueScript( 'givewp-donation-form-embed-app', 'build/donationFormBlockApp.js', diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx index 397c1bf908..22d7e0026d 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/app/Components/ModalForm.tsx @@ -42,6 +42,7 @@ export default function ModalForm({dataSrc, embedId, openFormButton, isFormRedir id={embedId} src={dataSrcUrl} checkOrigin={false} + heightCalculationMethod={'taggedElement'} style={{ minWidth: '100%', border: 'none', diff --git a/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx b/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx index 32d8d4fbca..27f11daff9 100644 --- a/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx +++ b/src/DonationForms/Blocks/DonationFormBlock/resources/app/index.tsx @@ -73,6 +73,7 @@ function DonationFormBlockApp({ id={embedId} src={dataSrc} checkOrigin={false} + heightCalculationMethod={'taggedElement'} style={{ width: '1px', minWidth: '100%',