mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-29 10:12:17 -05:00
fix: open text number question logic evaluation (#6439)
This commit is contained in:
@@ -502,7 +502,11 @@ const getLeftOperandValue = (
|
||||
const responseValue = data[leftOperand.value];
|
||||
|
||||
if (currentQuestion.type === "openText" && currentQuestion.inputType === "number") {
|
||||
return Number(responseValue) || undefined;
|
||||
if (responseValue === undefined) return undefined;
|
||||
if (typeof responseValue === "string" && responseValue.trim() === "") return undefined;
|
||||
|
||||
const numberValue = typeof responseValue === "number" ? responseValue : Number(responseValue);
|
||||
return isNaN(numberValue) ? undefined : numberValue;
|
||||
}
|
||||
|
||||
if (currentQuestion.type === "multipleChoiceSingle" || currentQuestion.type === "multipleChoiceMulti") {
|
||||
|
||||
@@ -99,7 +99,11 @@ const getLeftOperandValue = (
|
||||
const responseValue = data[leftOperand.value];
|
||||
|
||||
if (currentQuestion.type === "openText" && currentQuestion.inputType === "number") {
|
||||
return Number(responseValue) || undefined;
|
||||
if (responseValue === undefined) return undefined;
|
||||
if (typeof responseValue === "string" && responseValue.trim() === "") return undefined;
|
||||
|
||||
const numberValue = typeof responseValue === "number" ? responseValue : Number(responseValue);
|
||||
return isNaN(numberValue) ? undefined : numberValue;
|
||||
}
|
||||
|
||||
if (currentQuestion.type === "multipleChoiceSingle" || currentQuestion.type === "multipleChoiceMulti") {
|
||||
|
||||
Reference in New Issue
Block a user