feat(react-native): support skipSubmitButton for surveys#2967
Merged
Conversation
Add support for the skipSubmitButton feature in the React Native SDK, matching the browser SDK behavior. When enabled, rating and single-choice questions automatically submit upon selection without requiring users to click a submit button. Changes: - Add skipSubmitButton to RatingSurveyQuestion and MultipleSurveyQuestion types in core - Update BottomSection to conditionally hide submit button - Add auto-submit logic to RatingQuestion (emoji and number) - Add auto-submit logic to MultipleChoiceQuestion (single-choice only, without open choice) Closes #2963 Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Graphite Automations"sdk release label" took an action on this PR • (01/24/26)1 label was added to this PR based on Adam Bowker's automation. |
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Contributor
|
Size Change: +572 B (+0.01%) Total Size: 5.88 MB
ℹ️ View Unchanged
|
Add comprehensive unit tests for the skipSubmitButton feature: - Test skipSubmitButton property on rating questions (emoji and number) - Test skipSubmitButton property on single/multiple choice questions - Test surveys with mixed skipSubmitButton questions - Test behavior constraints (should work with rating and single-choice) - Test all rating scales (2, 3, 5, 7, 10) - Test interaction with hasOpenChoice All 17 tests passing. Co-Authored-By: Claude <noreply@anthropic.com>
Use it.each() to reduce test verbosity: - Reduced from 287 lines to 94 lines (67% reduction) - Combined repetitive tests using parameterized test cases - Removed redundant survey integration and constraint tests - Tests still cover all critical functionality Co-Authored-By: Claude <noreply@anthropic.com>
marandaneto
approved these changes
Jan 24, 2026
adboio
added a commit
to PostHog/posthog
that referenced
this pull request
Feb 3, 2026
## Problem updating survey version reqs with new features: - PostHog/posthog-js#2967 - PostHog/posthog-js#2966 <!-- Who are we building for, what are their needs, why is this important? --> <!-- Does this fix an issue? Uncomment the line below with the issue ID to automatically close it when merged --> <!-- Closes #ISSUE_ID --> ## Changes <!-- If there are frontend changes, please include screenshots. --> <!-- If a reference design was involved, include a link to the relevant Figma frame! --> ## How did you test this code? <!-- Briefly describe the steps you took. --> <!-- Include automated tests if possible, otherwise describe the manual testing routine. --> <!-- Docs reminder: If this change requires updated docs, please do that! Engineers are the primary people responsible for their documentation. 🙌 --> 👉 _Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review._ ## Publish to changelog? <!-- For features only --> <!-- If publishing, you must provide changelog details in the #changelog Slack channel. You will receive a follow-up PR comment or notification. --> <!-- If not, write "no" or "do not publish to changelog" to explicitly opt-out of posting to #changelog. Removing this entire section will not prevent posting. -->
warpbuild-benchmark-bot Bot
added a commit
to WarpBuilds/benchmarks-posthog
that referenced
this pull request
Feb 3, 2026
## Problem updating survey version reqs with new features: - PostHog/posthog-js#2967 - PostHog/posthog-js#2966 <!-- Who are we building for, what are their needs, why is this important? --> <!-- Does this fix an issue? Uncomment the line below with the issue ID to automatically close it when merged --> <!-- Closes #ISSUE_ID --> ## Changes <!-- If there are frontend changes, please include screenshots. --> <!-- If a reference design was involved, include a link to the relevant Figma frame! --> ## How did you test this code? <!-- Briefly describe the steps you took. --> <!-- Include automated tests if possible, otherwise describe the manual testing routine. --> <!-- Docs reminder: If this change requires updated docs, please do that! Engineers are the primary people responsible for their documentation. 🙌 --> 👉 _Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review._ ## Publish to changelog? <!-- For features only --> <!-- If publishing, you must provide changelog details in the #changelog Slack channel. You will receive a follow-up PR comment or notification. --> <!-- If not, write "no" or "do not publish to changelog" to explicitly opt-out of posting to #changelog. Removing this entire section will not prevent posting. -->
fercgomes
pushed a commit
to PostHog/posthog
that referenced
this pull request
Feb 4, 2026
## Problem updating survey version reqs with new features: - PostHog/posthog-js#2967 - PostHog/posthog-js#2966 <!-- Who are we building for, what are their needs, why is this important? --> <!-- Does this fix an issue? Uncomment the line below with the issue ID to automatically close it when merged --> <!-- Closes #ISSUE_ID --> ## Changes <!-- If there are frontend changes, please include screenshots. --> <!-- If a reference design was involved, include a link to the relevant Figma frame! --> ## How did you test this code? <!-- Briefly describe the steps you took. --> <!-- Include automated tests if possible, otherwise describe the manual testing routine. --> <!-- Docs reminder: If this change requires updated docs, please do that! Engineers are the primary people responsible for their documentation. 🙌 --> 👉 _Stay up-to-date with [PostHog coding conventions](https://posthog.com/docs/contribute/coding-conventions) for a smoother review._ ## Publish to changelog? <!-- For features only --> <!-- If publishing, you must provide changelog details in the #changelog Slack channel. You will receive a follow-up PR comment or notification. --> <!-- If not, write "no" or "do not publish to changelog" to explicitly opt-out of posting to #changelog. Removing this entire section will not prevent posting. -->
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
skipSubmitButtonfeature in the React Native SDK, matching the browser SDK behaviorChanges
skipSubmitButtontoRatingSurveyQuestionandMultipleSurveyQuestiontypes in@posthog/coreBottomSectioncomponent to conditionally hide submit button whenskipSubmitButtonis trueRatingQuestion(both emoji and number displays)MultipleChoiceQuestion(single-choice only, without open choice)Behavior
When
skipSubmitButton: trueis configured on a survey question:skipSubmitButtonis ignored (users need to select multiple options)skipSubmitButtonis ignored (users need to enter text)Closes #2963
Test plan
skipSubmitButton: true- should auto-submit on selectionskipSubmitButton: true- should auto-submit on selectionskipSubmitButton: true- should still show submit buttonskipSubmitButton: true- should still show submit button🤖 Generated with
Claude CodeTWIG! 🦔