Skip to content

Commit

Permalink
Survey Creator V1 - When clicking a question within a panel, a panel …
Browse files Browse the repository at this point in the history
…appears selected in a Property grid fix #5487
  • Loading branch information
andrewtelnov committed May 15, 2024
1 parent b39e789 commit 7d731f3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/survey-creator/src/surveyjsObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,20 @@ export function createAfterRenderHandler(
}
});
domElement.onclick = function (e) {
if (!e["markEvent"]) {
if (!e["markEvent"] && (!survey || !survey.selectedOnClick)) {
e["markEvent"] = true;
if (surveyElement.parent) {
surveyElement.selectedOnClick = true;
if (!!survey) {
survey.selectedOnClick = true;
}
getSurvey(surveyElement)["selectedElement"] = surveyElement;
surveyElement.selectedOnClick = false;
setTimeout(() => {
if (!!survey) {
survey.selectedOnClick = undefined;
}
}, 150);
}
}
};
Expand Down Expand Up @@ -346,7 +354,7 @@ export function createAfterRenderPageHandler(
page.renderedElement = domElement;
domElement.classList.add("svd_page");
domElement.onclick = function (e) {
if (!e["markEvent"]) {
if (!e["markEvent"] && (!survey || !survey.selectedOnClick)) {
e["markEvent"] = true;
getSurvey(page)["selectedElement"] = page;
}
Expand Down Expand Up @@ -572,7 +580,7 @@ questionPrototype["onSelectedElementChanged"] = function () {
Survey.QuestionSelectBaseImplementor.prototype["onCreated"] = function () {
var q: any = this.question;
var updateTriggerFunction = function () {
if(!!q && !!q.survey && !q.survey.isDesignMode) return;
if (!!q && !!q.survey && !q.survey.isDesignMode) return;
setTimeout(() => q["koElementType"].notifySubscribers(), 0);
};
[
Expand Down

0 comments on commit 7d731f3

Please sign in to comment.