From 4b67b0e0a2d5931e2668911348dc92c57bcdaea6 Mon Sep 17 00:00:00 2001 From: pandeymangg Date: Thu, 3 Sep 2026 12:22:01 +0530 Subject: [PATCH] fix: restore touch pass-through for no-overlay surveys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../lib/src/widgets/survey_html.dart | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/formbricks/lib/src/widgets/survey_html.dart b/packages/formbricks/lib/src/widgets/survey_html.dart index 0416691..873fe90 100644 --- a/packages/formbricks/lib/src/widgets/survey_html.dart +++ b/packages/formbricks/lib/src/widgets/survey_html.dart @@ -162,12 +162,18 @@ String buildSurveyHtml(SurveyHtmlOptions options) { var fbGeometryRaf = null; var fbGeometryStable = 0; function fbCardRect() { - // The survey card is the single modal dialog the runtime renders inside - // its #fbjs container (survey-container.tsx). Scoped + both attributes - // so we never grab the full-screen #fbjs wrapper (that would defeat - // box-none) or a future nested dialog. querySelector returns the - // outermost match in document order, i.e. the card itself. - var el = document.querySelector('#fbjs [role="dialog"][aria-modal="true"]'); + // The survey card is the single dialog the runtime renders inside its + // #fbjs container (survey-container.tsx). Scoped to #fbjs so we never + // grab the full-screen wrapper (that would defeat box-none); + // querySelector returns the outermost match in document order, i.e. + // the card itself. + // + // Deliberately NOT matched on aria-modal. The runtime sets that + // attribute only when the survey has a backdrop (ENG-2304), so + // requiring it matched nothing in exactly the no-overlay case this + // mask exists for -- the rect stayed null and the card became + // untappable. Match on role alone: it is on the card in every mode. + var el = document.querySelector('#fbjs [role="dialog"]'); if (!el) return null; var r = el.getBoundingClientRect(); if (r.width <= 0 || r.height <= 0) return null;