appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.95k stars 3.66k forks source link

[Bug]: List widget evaluates when nested in a modal and the modal is not open #21694

Open jacquesikot opened 1 year ago

jacquesikot commented 1 year ago

Is there an existing issue for this?

Description

When a new list widget is created within a modal and a query is bound to it to display data in the list, closing the modal causes an error with the list item displaying "currentItem is not defined". The error disappears when the modal is opened again, but reappears once the modal is closed. The expected behaviour is that there should be no errors when the app is opened, with the modal closed, as the query has been set to Run on Page Load and is returning the correct data.

Expected Result: When the app is opened, with the modal closed, there should be no errors as the query has been set to Run on Page Load and is returning the correct data.

Actual Result: Closing the modal causes an error with the list item displaying "currentItem is not defined". The error disappears when the modal is opened again, but reappears once the modal is closed.

Additional Information: This bug may be caused by a failure to properly initialise the list widget data when the modal is closed. The issue should be addressed by ensuring that the list widget data is properly initialised on page load, even when it is nested in a modal.

Steps To Reproduce

Public Sample App

https://app.appsmith.com/app/listissueapp/page1-641acc9953066d1510cc4315

Environment

Production

Issue video log

No response

Version

Cloud - v1.9.12-SNAPSHOT

dilippitchika commented 1 year ago

@jacquesikot i see the app to be empty, can you add the app's json here?

jacquesikot commented 1 year ago

@dilippitchika Sorry about that, i did not deploy, please check now

dilippitchika commented 1 year ago

@Tooluloope can you triage this - https://www.loom.com/share/020b86bfec03407fa438c84a34ceb258

vsvamsi1 commented 1 year ago

The issue is that the flag to suppress eval errors for a list (suppressDebuggerError) is lost when modal is closed. This is because the flag is held in the metaState of the list widget and when the modal closes, the list calls the deleteMetaWidgets action which deletes the metaState.

One solution is to maintain the suppressDebuggerError flag in the blueprint object which is not transient state like the metaState. However there is complexity around copying the list widget to a location outside the modal like in the canvas. @dilippitchika

ame-appsmith commented 6 months ago

Another BE user reported this issue.