feat(surveys): submit open text questions with Cmd/Ctrl+Enter#3613
Merged
lucasheriques merged 2 commits intoMay 15, 2026
Conversation
Adds the standard multi-line input shortcut (Cmd/Ctrl+Enter to submit) to the open text survey question's textarea, matching Slack, GitHub, Discord, and ChatGPT. Plain Enter still inserts a newline. Also locks in the existing plain-Enter submit behaviour for the single-line "Other:" input on single-choice questions with a test, so it can't silently regress. Generated-By: PostHog Code Task-Id: b217e1be-540c-4a75-ac19-71be61f91104
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Graphite Automations"sdk release label" took an action on this PR • (05/14/26)1 label was added to this PR based on Adam Bowker's automation. "Add graphite merge queue [copy]" took an action on this PR • (05/14/26)2 labels were added to this PR based on Lucas Faria's automation. |
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/browser/src/__tests__/extensions/surveys/question-types.test.tsx:305-325
**Prefer parameterised tests for metaKey / ctrlKey variants**
The two modifier keys (`metaKey` and `ctrlKey`) are tested in a single test case with sequential assertions. Per the team's convention, each input variant should be a separate parameterised case so a failure pinpoints exactly which modifier broke. A `it.each` table would express this clearly and keeps every assertion independent.
Reviews (1): Last reviewed commit: "feat(surveys): submit open text question..." | Re-trigger Greptile |
Contributor
Contributor
|
Size Change: +706 B (0%) Total Size: 16 MB
ℹ️ View Unchanged
|
Splits the combined modifier test into an it.each table so metaKey and ctrlKey report independently, and extracts the plain-Enter negative case into its own test. Generated-By: PostHog Code Task-Id: b217e1be-540c-4a75-ac19-71be61f91104
Contributor
|
Reviews (2): Last reviewed commit: "test(surveys): parameterise Cmd/Ctrl+Ent..." | Re-trigger Greptile |
gantoine
approved these changes
May 15, 2026
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.
Summary
"Other:"inputs on single-choice questions already submit on plain Enter — no change there, but I added a test to lock that behaviour in so it can't silently regress.Test plan
pnpm test:unit:surveys— 33/33 passing, including two new tests:submits on Cmd/Ctrl+Enter when input is valid(covers bothmetaKeyandctrlKey, and verifies plain Enter does not submit)does not submit on Cmd/Ctrl+Enter when validation failssubmits open-ended choice on Enter key(locks in existing single-choice "Other:" behaviour)Created with PostHog Code