feat(react-native): allow disabling survey ScrollView via appearance.disableScrolling#3534
Draft
posthog[bot] wants to merge 1 commit intomainfrom
Draft
feat(react-native): allow disabling survey ScrollView via appearance.disableScrolling#3534posthog[bot] wants to merge 1 commit intomainfrom
posthog[bot] wants to merge 1 commit intomainfrom
Conversation
…disableScrolling Adds an opt-in `disableScrolling` flag on `SurveyAppearance`. When true, the RN `QuestionLayout` renders the question body directly inside its container, dropping the wrapping `ScrollView` (and its `keyboardShouldPersistTaps`). Default is `false` to preserve current behavior. Resolves UX issues reported in posthog-react-native#589 for short single-question surveys (iOS bounce / keyboard tap-handling). Overflowing content is silently clipped when enabled — documented in the field's JSDoc. Generated-By: PostHog Code Task-Id: 3d118a75-e330-48d6-8d26-df6e8e2f0e74
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Contributor
|
Size Change: +213 B (0%) Total Size: 15.9 MB
ℹ️ View Unchanged
|
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
disableScrolling?: booleanflag onSurveyAppearance(in@posthog/core).appearance.disableScrollingistrue, the React NativeQuestionLayoutrenders the question body directly inside its container<View>and drops the wrapping<ScrollView>(and itskeyboardShouldPersistTaps="handled"wiring). Default remainsfalseto preserve current behavior.defaultSurveyAppearanceso the resolvedSurveyAppearanceThemealways has a concrete boolean.Why
Tracks posthog-react-native#589: the unconditional
ScrollViewintroduced in135d0ef(#3498) causes UX issues for short, single-question surveys (iOS bounce, keyboard tap-handling). Embedders need a way to opt out for surveys that fit in a single screen. Caveat: any content overflowing the modal's height is silently clipped when this is enabled — documented in the field's JSDoc.Reach
Embedders can pass
disableScrolling: trueviadefaultSurveyAppearanceonPostHogSurveyProvider, or set it on a survey's appearance in PostHog. The flag flows through unchanged via the existing appearance plumbing — no new provider props were needed.Test plan
surveys-disableScrolling.spec.tsasserts:ScrollViewinsideQuestionLayoutappearance.disableScrolling: truedrops theScrollViewpnpm --filter posthog-react-native test:unit— 327 tests)@posthog/coretest suite passes (pnpm --filter @posthog/core test:unit— 532 tests)pnpm --filter posthog-react-native lintpassespnpm --filter posthog-react-native buildpassespnpm --filter @posthog/core buildpassesCreated with PostHog Code