Submit button on module doesn't work in one specific app but does in all other scenarios

On Thursday 2/29, I set up a module that uses a form container to submit a form, and put it into a modal container in an app. Everything worked great (I can share a video or screenshots to this effect); the form correctly submitted the data query and ran the onSubmit trigger I had set up for it.

On Friday 3/1, the module's submit button stopped working. All other behavior for the module operated correctly: it ran its startup queries, all of the form input fields worked and validated as expected. The submit button is the ONLY piece that doesn't seem to want to work anymore. It does nothing when clicked, including run the "required" form check before submission, the actual data submission, or the onSubmit input triggers set up from the wider app.

My thought was perhaps I'd messed something up while working on the app, so I deleted the module and set it back up. That didn't resolve the issue; nor did moving it out of the modal into the main frame. I even deleted the other modules in the app and readded it to no avail, thinking it might have been some weird ordering/query issue.

To further complicate matters the module works properly in its own view and even works in other apps (or at least new blank apps), in any kind of frame set up I can through at it. So it doesn't appear to be an issue with the module or putting the module into a given app, it's just something specific about using this module with this app. Duplicating the app and readding the module also causes the button to not work (both recreating by dumping the JSON and uploading and by using the button in the Retool menu).

I'm not sure how to debug a conflict with my app and a module without having access to loading logs or something more central to the Retool platform, so I'm reaching out for help. If there's some knowledge about Modules in modals or other quirks of modules I'm not aware of, that would be helpful as well.

@Grahame Do you see any errors in the Retool Debug console or in your Browser Developer Tools console when you click the submit button?

Separately, can you share the full chain of events that are configured to run on submit?

Hi Everett,

There are no errors for the module when it's embedded in the app that's causing the issues. It is loading its own queries (see screenshot; newItemForm1::getSkus is an internal module query) but somewhat tellingly I'm not even getting a form validation error when I click submit and "Item Name" isn't filled out, never mind any other kind of errors. This is what leads me to believe something is blocking the module from loading properly; the submit button does change color on mouseover and click, it just doesn't fire events:

In terms of submit event handlers, there's only one: onSubmit.trigger(), where onSubmit is the default module input query. You can see in this screenshot that the form validation does work when it's at the module level only, and adding other events to the submit action do fire correctly:

It also does work properly if just dumped into another random app:

The only other thing I could think of is that it's a fairly complex modal tree in the malfunctioning app, so I tried moving it to different frames, but the behavior (or lack thereof I guess) remains in the Main, Sidebar, and brand new modal frames as well.

I see thanks for sharing adding all of this context! Is there any way you could share a JSON export of the module and the app where you're seeing this issue for our team to inspect in our environment? If you're not comfortable sharing these files publicly, you could send them to me in a DM.

You bet. Let me know if there's other context I can provide.

In the meantime, I've sent you the app and the module JSON directly.

Hi @Grahame,

I'm jumping in here :slight_smile: Everett shared the export with me.

I noticed that it seems to be some conflict between the ReceivePoModal & NewItemModal.

If I delete the poReceiveItems inside of ReceivePoModal, then the submit button in NewItemModal starts working. I know that isn't really a solution, but I wanted to give you that update. I'll keep digging into it a bit more, and will request a fix from our team internally

Can you try renaming form1 in poReceiveItems (in ReceivePoModal)? I think that might fix it for now🤞

Hi Tess,

It seems to be working now; I didn't make any of those changes so I'm not entirely sure what was going on. I'll keep an eye on it and if it comes back I'll let you know. Perhaps there was some odd hiccup deep in the system that it was conflicting with that got resolved?

Thanks for the help!

Interesting :thinking: Glad to hear! I didn't see this specific issue called out, but we did just ship an update yesterday, so it's possible