Compare commits

...

3 Commits

Author SHA1 Message Date
pandeymangg
a651defd74 chore: merge with main 2025-10-27 21:18:27 +05:30
pandeymangg
b3fe7ee4d9 isPreviewMode fix 2025-10-27 21:16:51 +05:30
Aashish-png
bf2f4ea381 fix-6739- enter button on welcome card editor 2025-10-25 14:18:35 +05:30
2 changed files with 7 additions and 3 deletions

View File

@@ -692,6 +692,7 @@ export function Survey({
isCurrent={offset === 0}
responseData={responseData}
variablesData={currentVariables}
isPreviewMode={isPreviewMode}
fullSizeCards={fullSizeCards}
/>
);

View File

@@ -25,6 +25,7 @@ interface WelcomeCardProps {
responseData: TResponseData;
variablesData: TResponseVariables;
fullSizeCards: boolean;
isPreviewMode?: boolean;
}
function TimerIcon() {
@@ -78,6 +79,7 @@ export function WelcomeCard({
responseData,
variablesData,
fullSizeCards,
isPreviewMode = false,
}: WelcomeCardProps) {
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);
} else {
document.removeEventListener("keydown", handleEnter);
@@ -134,8 +137,8 @@ export function WelcomeCard({
document.removeEventListener("keydown", handleEnter);
};
// eslint-disable-next-line react-hooks/exhaustive-deps -- only want to run this effect when isCurrent changes
}, [isCurrent]);
// eslint-disable-next-line react-hooks/exhaustive-deps -- only want to run this effect when isCurrent or isPreviewMode changes
}, [isCurrent, isPreviewMode]);
return (
<ScrollableContainer fullSizeCards={fullSizeCards}>