File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/scheduled-tasks/components/task-modal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,6 +138,13 @@ export function TaskModal({
138138 * Escape, and overlay click all route through this one handler — so an
139139 * in-progress create/edit can't be abandoned and lose its draft. `submitting`
140140 * lives here (not in the unmounted-on-close content) so this guard can see it.
141+ *
142+ * The programmatic close on a *successful* submit is intentionally NOT blocked:
143+ * `handleSubmit` runs in the pre-submit render where `submitting` was still
144+ * false, so its `close()` resolves to that render's handler and passes through,
145+ * while user dismisses fire from the current (submitting) render and are caught
146+ * here. Keep `submitting` as render state — moving it to a ref or memoizing this
147+ * handler with `submitting` in deps would make the success-close start blocking.
141148 */
142149 const handleOpenChange = ( next : boolean ) => {
143150 if ( ! next && submitting ) return
You can’t perform that action at this time.
0 commit comments