Submit button not triggering
Have we seen anything where the "submit" button on a form isn't updating the values of the input form in app mode?
I have an app and when I'm in the app view, the submit button doesn't seem to be updating the values for the inputs. However, when I switch from app view to code editor, the submit button works
11 Replies
Strange, I haven't seen that before. Any chance you can share code that reproduces the issue?
Let me see, the notebook I have working on is pretty indepth with local code.
Let me try to reproduce with a simpler notebook
In the meantime, here's a screen recording if that helps
hmm interesting. what version of marimo?
it's really weird that it works when you toggle to edit mode and then back ...
Can you try something? Where you output
form.value
, instead of making it the output of the cell, can you use Python print? print(form.value)
. Then see if in the preview mode whether the correct value is printed? I'm curious if this is a frontend issue or backend issueI could recreate with this
print(input_form.value)
gives the old valueThat's helpful, thanks! I can take a look
🫶
I think there's some state in the frontend that doesn't get updated. Switching from edit to run mode or vice versa "fixes" it because the form component gets unmounted which clears the form state as a side effect
Got a pretty minimal repro. Thanks for bringing this to our attention.
Just put out a PR that should fix this issue, will let you know when a fix is merged and released
Thanks @Akshay