mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-23 14:40:44 -06:00
Compare commits
3 Commits
unit-test-
...
fix-6739-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a651defd74 | ||
|
|
b3fe7ee4d9 | ||
|
|
bf2f4ea381 |
@@ -692,6 +692,7 @@ export function Survey({
|
|||||||
isCurrent={offset === 0}
|
isCurrent={offset === 0}
|
||||||
responseData={responseData}
|
responseData={responseData}
|
||||||
variablesData={currentVariables}
|
variablesData={currentVariables}
|
||||||
|
isPreviewMode={isPreviewMode}
|
||||||
fullSizeCards={fullSizeCards}
|
fullSizeCards={fullSizeCards}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ interface WelcomeCardProps {
|
|||||||
responseData: TResponseData;
|
responseData: TResponseData;
|
||||||
variablesData: TResponseVariables;
|
variablesData: TResponseVariables;
|
||||||
fullSizeCards: boolean;
|
fullSizeCards: boolean;
|
||||||
|
isPreviewMode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function TimerIcon() {
|
function TimerIcon() {
|
||||||
@@ -78,6 +79,7 @@ export function WelcomeCard({
|
|||||||
responseData,
|
responseData,
|
||||||
variablesData,
|
variablesData,
|
||||||
fullSizeCards,
|
fullSizeCards,
|
||||||
|
isPreviewMode = false,
|
||||||
}: WelcomeCardProps) {
|
}: WelcomeCardProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -124,7 +126,8 @@ export function WelcomeCard({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isCurrent && survey.type === "link") {
|
// Only attach listener when current, link type, and NOT in preview mode
|
||||||
|
if (isCurrent && survey.type === "link" && !isPreviewMode) {
|
||||||
document.addEventListener("keydown", handleEnter);
|
document.addEventListener("keydown", handleEnter);
|
||||||
} else {
|
} else {
|
||||||
document.removeEventListener("keydown", handleEnter);
|
document.removeEventListener("keydown", handleEnter);
|
||||||
@@ -134,8 +137,8 @@ export function WelcomeCard({
|
|||||||
document.removeEventListener("keydown", handleEnter);
|
document.removeEventListener("keydown", handleEnter);
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- only want to run this effect when isCurrent changes
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- only want to run this effect when isCurrent or isPreviewMode changes
|
||||||
}, [isCurrent]);
|
}, [isCurrent, isPreviewMode]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollableContainer fullSizeCards={fullSizeCards}>
|
<ScrollableContainer fullSizeCards={fullSizeCards}>
|
||||||
|
|||||||
Reference in New Issue
Block a user