From 749f11b835cb67d644871b6b20a21b66af781c9d Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Thu, 12 Dec 2024 17:09:53 +0530 Subject: [PATCH] chore: fix custom widget 's updateModel (#38129) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /ok-to-test tags="@tag.Anvil" Fixes a bug where appsmith.updateModel was not working properly. ## Summary by CodeRabbit - **Bug Fixes** - Updated the handling of model updates in the Custom Widget, improving the way messages are processed from the iframe. - **Documentation** - Clarified the expected input for the `onUpdateModel` function in relation to the message object. > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: cb0ae84342e991d2027a49f3032e815688bcc787 > Cypress dashboard. > Tags: `@tag.Anvil` > Spec: >
Thu, 12 Dec 2024 11:12:50 UTC --- .../ui-builder/ui/wds/WDSCustomWidget/component/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/component/index.tsx b/app/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/component/index.tsx index 9b0e7d4523..93c7cedabb 100644 --- a/app/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/component/index.tsx +++ b/app/client/src/modules/ui-builder/ui/wds/WDSCustomWidget/component/index.tsx @@ -80,7 +80,7 @@ export function CustomWidgetComponent(props: CustomWidgetComponentProps) { // the iframe can make changes to the model, when it needs to // this is done by sending a CUSTOM_WIDGET_UPDATE_MODEL message to the parent window const handleModelUpdate = (message: Record) => { - onUpdateModel(message.model as Record); + onUpdateModel(message as Record); }; // the iframe elements can trigger events. Triggered events here would mean