appsmith
appsmith copied to clipboard
[Bug]: List widget evaluates when nested in a modal and the modal is not open
Is there an existing issue for this?
- [X] I have searched the existing issues
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
- Create a new list widget and place it within a modal.
- Bind a query to the widget to display data in the list.
- Close the modal and refresh the page.
- Observe the error message "currentItem is not defined".
- Open the modal and observe that the error disappears.
- Close the modal again and observe that the error reappears.
Public Sample App
https://app.appsmith.com/app/listissueapp/page1-641acc9953066d1510cc4315
Environment
Production
Issue video log
No response
Version
Cloud - v1.9.12-SNAPSHOT
@jacquesikot i see the app to be empty, can you add the app's json here?
@dilippitchika Sorry about that, i did not deploy, please check now
@Tooluloope can you triage this - https://www.loom.com/share/020b86bfec03407fa438c84a34ceb258
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
Another BE user reported this issue.