Skip to content

Commit 5430bc9

Browse files
committed
docs: fix an inverted comment in the quiz-form example
The comment in final_form/app.py said ReactPy 'still submits the form's defaults' when preventDefault() is detected -- the opposite of what it does. It suppresses the default navigation, which is the only reason the async handler survives long enough to render the result. Verified in Chrome: submitting stays on the page (pathname '/'), the textarea and button lock during the await, and the error paragraph appears after it resolves. Measured prevent_default detection on the shipped bytecode: direct call True, async handler awaiting after the call True, call hidden in a helper False, rebound argument False -- so the comment's warning about indirection is now stated explicitly. Also correct running-tests.md's summary bullet that called the docs checks a gate on every pull request; nothing gates them (see about/code.md).
1 parent 24cbacd commit 5430bc9

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎docs/examples/reacting_to_input_with_state/final_form/app.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ def form():
2222
return html.h1("That's right!")
2323

2424
async def handle_submit(event):
25-
# Awaiting inside the handler is fine: ReactPy still submits the form's
26-
# defaults because it detects preventDefault() from the handler's code,
27-
# not from when it runs.
25+
# Awaiting inside the handler is fine: ReactPy still suppresses the
26+
# form's default navigation, because it detects the preventDefault()
27+
# call by reading this function's bytecode -- whether or not the handler
28+
# ever finishes does not matter. The call must appear in this function
29+
# itself, though: hiding it in a helper defeats the inspection.
2830
event.preventDefault()
2931
set_status("submitting")
3032
try:

‎docs/src/about/running-tests.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ There are two test suites in this project, and they live in different places. Th
99
!!! summary "You will learn"
1010

1111
- How to run the Python test suite, and why it needs a browser installed
12-
- How to run the documentation build checks that gate every docs pull request
12+
- How to run the documentation build checks yourself, since no CI runs them for you
1313
- Which command failures are yours and which are environmental
1414

1515
!!! abstract "Note"

0 commit comments

Comments
 (0)