mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-18 11:31:12 -05:00
feat: auto prefilled prev ID when Question ID is left empty (#1038)
Co-authored-by: Rohan Gupta <rohan.gupta@zopper.com>
This commit is contained in:
@@ -22,8 +22,10 @@ export default function UpdateQuestionId({ localSurvey, question, questionIdx, u
|
||||
setIsInputInvalid(true);
|
||||
toast.error("IDs have to be unique per survey.");
|
||||
} else if (currentValue.trim() === "" || currentValue.includes(" ")) {
|
||||
setIsInputInvalid(true);
|
||||
setCurrentValue(prevValue);
|
||||
updateQuestion(questionIdx, { id: prevValue });
|
||||
toast.error("ID should not be empty.");
|
||||
return;
|
||||
} else {
|
||||
setIsInputInvalid(false);
|
||||
toast.success("Question ID updated.");
|
||||
|
||||
Reference in New Issue
Block a user