Skip to content

fix: restore touch pass-through for no-overlay surveys - #46

Merged
Dhruwang merged 1 commit into
mainfrom
anshuman/fix-flutter-no-overlay-card-unresponsive
Sep 3, 2026
Merged

fix: restore touch pass-through for no-overlay surveys#46
Dhruwang merged 1 commit into
mainfrom
anshuman/fix-flutter-no-overlay-card-unresponsive

Conversation

@pandeymangg

@pandeymangg pandeymangg commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What & why

Was: an app survey with overlay: none rendered a card that could not be tapped at all. Not the old "host app is frozen" bug — the card itself was dead, so the survey was unusable and undismissable except by finishing the host flow.

Now: the card takes touches again, and taps outside it still pass through to the host app.

The card-geometry probe matched #fbjs [role="dialog"][aria-modal="true"]. The surveys runtime now sets aria-modal only when a survey has a backdrop (monorepo PR formbricks/formbricks#8804), so the selector matched nothing in exactly the no-overlay case the pointer mask exists for. fbCardRect() returned null forever, the reported rect stayed null, and _RenderPointerMask rejected pointers across the whole WebView.

Fix is to match role="dialog" alone — it is on the card in every overlay mode, and scoping to #fbjs still keeps the probe off the full-screen wrapper.

The runtime is fetched from the server at render time, so this landed on every host pointed at a current server with no SDK release involved. It has been live since that monorepo PR deployed.

Where to look

  • packages/formbricks/lib/src/widgets/survey_html.dart — the selector, and a comment recording why aria-modal must not be matched.

Coverage

Behaviour Level
No-overlay card accepts taps; outside taps reach host manual — reproduced broken on a local host app, confirmed working on this branch
Existing pointer-mask / geometry semantics unchanged unit (guard) — packages/formbricks/test/widgets/survey_webview_test.dart, 73 pass

Rerun: cd packages/formbricks && flutter test test/widgets/

Open gaps

No test can fail on this. The probe is a JS string inside Dart that the widget tests never execute — they inject the geometry event directly, so the selector itself is only ever exercised at runtime. The durable fix is to have the surveys renderer emit the card rect over a stable contract so no SDK scrapes the DOM; that is follow-up work in the monorepo and would cover iOS and React Native too, both of which still block host touches entirely.

Breaking changes

  • This is a breaking change

Restores intended behaviour on a public API that did not change.

The card-geometry probe matched `#fbjs [role="dialog"][aria-modal="true"]`.
The surveys runtime now sets `aria-modal` only when a survey has a backdrop,
so the selector matched nothing in exactly the no-overlay case the pointer
mask exists for. `fbCardRect()` returned null forever, the reported rect
stayed null, and `_RenderPointerMask` rejected pointers across the whole
WebView — the survey card became untappable.

Match on `role="dialog"` alone. It is on the card in every overlay mode, and
scoping to `#fbjs` still keeps the probe off the full-screen wrapper.

The runtime is loaded from the server at render time, so this reached every
host on a current server without an SDK release. Nothing here can be covered
by a test: the probe is a JS string inside Dart that the widget tests never
execute (they inject the geometry event directly). The broken state was
reproduced by hand on a local host app; the fix needs the same check before
merge.
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: b2a3f4db-748a-4651-9ba4-6590147e9acb


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pandeymangg
pandeymangg requested a review from Dhruwang September 3, 2026 06:53
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@Dhruwang
Dhruwang merged commit 5885de2 into main Sep 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants