fix: discussions not submittable - #3676
Open
isTravis wants to merge 1 commit into
Open
Conversation
isTravis
requested review from
tefkah
and
a lite review from Copilot
and removed request for
Copilot
August 17, 2026 13:47
Copilot stopped reviewing on behalf of
isTravis due to an error
August 17, 2026 13:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix silently dropped discussion submits caused by Altcha's hidden required checkbox
Problem
Typing a comment on a pub draft and clicking Post Discussion does nothing. The console shows:
Tab-selecting the button and pressing Enter works, which makes it look like a click-vs-keyboard bug. It isn't - it's a timing race with the Altcha widget.
Two facts combine badly:
use_shadow_dom = false(altcha/dist/altcha.js:3091), so the widget puts a real<input type="checkbox">inside our<form>. That checkbox isrequiredunlessauto === 'onsubmit'(altcha.js:2807), and it is onlycheckedonce the widget reaches itsverifiedstate (altcha.js:2316).Altcha.tsx:139setsdisplay: altchaVisible ? 'block' : 'none', andaltchaVisiblestartsfalse. Altcha never emits astatechangefor the initialunverifiedstate, so the widget is invisible in exactly the state where its checkbox is invalid.Result: if a submit is attempted before verification completes, the browser hits a
required, unchecked control it cannot focus, logs "An invalid form control is not focusable", and cancels the submit. OuronSubmitnever runs.Why verification hadn't completed yet: with
auto="onfocus", Altcha begins verifying on the form's firstfocusin(altcha.js:2292). ButDiscussionInput.tsx:62-66auto-focuses the editor on mount, whileAltcha.tsx:34-36only renders the widget afterimport('altcha')resolves — so the focus that should have started verification fires before the listener exists. Verification then doesn't start until something else focuses inside the form.Clicking the button focuses it, which finally fires
focusinand starts verification — but that path awaits a 500ms delay plus proof-of-work, while native validation runs synchronously on the same click. So the first click always loses. By the time you tab over and press Enter, that earlier click's verification has finished and the checkbox is checked, so it submits. A freshly loaded form fails the same way on tab+Enter; the keyboard isn't actually privileged.Altcha would normally surface this — it has an
invalidhandler that alertswaitAlert(altcha.js:2814,altcha.js:2303) — butDiscussionInput.tsxblanks that string out to suppress the noisy alert, so the failure is completely silent.Change
Add
noValidateto the discussion form inDiscussionInput.tsx.Both submit handlers already
await altchaRef.current?.verify(), so native constraint validation of Altcha's internal checkbox is redundant — and actively harmful, since it gates the submit on state that our own handler is responsible for producing. With it off, the submit event fires,verify()drives the captcha, and the post goes through.No other validated controls exist in this form: the honeypot input and the guest-name
InputGroupare notrequired.Testing
auto="onload", so already verified): unchanged, still instant.biome checkclean on the touched file.