fix(translation): let onSurveyInstanceCreated override side-by-side pane setup - #8032
Merged
andrewtelnov merged 1 commit intoOct 1, 2026
Merged
Conversation
…ane setup Co-authored-by: Cursor <cursoragent@cursor.com>
andrewtelnov
marked this pull request as draft
September 30, 2026 18:40
andrewtelnov
marked this pull request as ready for review
September 30, 2026 18:40
andrewtelnov
approved these changes
Oct 1, 2026
andrewtelnov
deleted the
fix/translation-renderer-override-in-survey-created
branch
October 1, 2026 09:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source issue
T27713 - Multi-Language Side-by-Side Comparison View
https://surveyjs.answerdesk.io/internal/ticket/details/T27713
Problem
In the side-by-side Translation tab, the source and target pane surveys are configured (
setupSourceSurvey/setupTargetSurvey) aftercreateSurveyreturns, i.e. afteronSurveyInstanceCreatedhas already fired. As a result, anything a handler assigns inonSurveyInstanceCreatedfor thetranslation-tab:source-survey/translation-tab:target-surveyareas (e.g.survey.getRendererForStringto plug in a custom inplace string editor such as a rich-text editor) is silently overwritten by the creator.The designer survey does not have this problem:
initializeDesignTimeSurveyModelruns insidecreateSurvey, before the event. So customers had to defer their assignment (e.g.queueMicrotask) to make it stick in the translation panes.Fix
Run
setupSourceSurvey/setupTargetSurveyinside thecreateSurveycallback ofcreateInstance, which is invoked beforeonSurveyInstanceCreated. The methods only configure the passed survey instance (event handlers and callbacks), so moving them earlier does not change their behavior.setupSourceEmptySpaces,buildMappings, etc. still run after both panes are created.Now
onSurveyInstanceCreatedis consistently the place where handlers get the last word, for the designer and for the translation panes:Tests
onSurveyInstanceCreatedhandlers override the string renderers of both panes (fails without the fix).CreatorTesterassigns its owngetRendererForStringinonSurveyInstanceCreatedfor every survey; it now skips the two translation pane areas so the existing tests keep checking the panes' own renderers.