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} isCurrent={offset === 0}
responseData={responseData} responseData={responseData}
variablesData={currentVariables} variablesData={currentVariables}
isPreviewMode={isPreviewMode}
fullSizeCards={fullSizeCards} fullSizeCards={fullSizeCards}
/> />
); );

View File

@@ -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}>