mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-21 18:18:48 -06:00
fix: survey preview updation issues (#3269)
This commit is contained in:
committed by
GitHub
parent
ea0df287d9
commit
21e9e9167f
@@ -54,6 +54,11 @@ export const Survey = ({
|
||||
}: SurveyBaseProps) => {
|
||||
const [localSurvey, setlocalSurvey] = useState<TSurvey>(survey);
|
||||
|
||||
// Update localSurvey when the survey prop changes (it changes in case of survey editor)
|
||||
useEffect(() => {
|
||||
setlocalSurvey(survey);
|
||||
}, [survey]);
|
||||
|
||||
const autoFocusEnabled = autoFocus !== undefined ? autoFocus : window.self === window.top;
|
||||
|
||||
const [questionId, setQuestionId] = useState(() => {
|
||||
|
||||
Reference in New Issue
Block a user