Skip to content

Commit

Permalink
Merge pull request #8930 from surveyjs/bug/8919-resize-handle-disappe…
Browse files Browse the repository at this point in the history
…ared

Long Text / Comment - A resize handle disappeared in newer versions of SurveyJS Form Library
  • Loading branch information
andrewtelnov authored Oct 14, 2024
2 parents e377ae5 + c6797b1 commit 4fc3dfa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
7 changes: 5 additions & 2 deletions packages/survey-core/src/question_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ export class QuestionCommentModel extends QuestionTextBase {
}
public get renderedAllowResize(): boolean {
const res = this.allowResize;
const allowResize = res === undefined && this.survey ? this.survey.allowResizeComment : !!res;
return allowResize && !this.isPreviewStyle && !this.isReadOnlyStyle;
if (res === undefined && this.survey) {
return this.survey.allowResizeComment;
} else {
return !!res;
}
}
public get resizeStyle() {
return this.renderedAllowResize ? "both" : "none";
Expand Down
6 changes: 1 addition & 5 deletions packages/survey-core/tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15609,13 +15609,9 @@ QUnit.test("survey.allowResizeComment", function (assert) {
assert.equal(comment1.renderedAllowResize, true, "comment1 survey.allowResizeComment = true, #3");
assert.equal(comment2.renderedAllowResize, false, "comment2 survey.allowResizeComment = true, #4");

comment1.readOnly = true;
assert.equal(comment1.renderedAllowResize, false, "#5");
comment1.readOnly = false;

survey.showPreview();
let comment1Preview = survey.getQuestionByName("comment1");
assert.equal(comment1Preview.renderedAllowResize, false, "#6");
assert.equal(comment1Preview.renderedAllowResize, true, "#5");
});

QUnit.test("survey.allowResizeComment & survey.autoGrowComment override this properties for individual properties", function (assert) {
Expand Down
2 changes: 1 addition & 1 deletion tests/markup/snapshots/comment-readonly.snap.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<textarea aria-invalid="false" aria-label="Question title" aria-required="false" cols="50" id="testid0i" readonly="" rows="4" style="resize:none;">
<textarea aria-invalid="false" aria-label="Question title" aria-required="false" cols="50" id="testid0i" readonly="" rows="4" style="resize:both;">
</textarea>
Binary file modified visualRegressionTests/tests/defaultV2/etalons/preview-comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified visualRegressionTests/tests/defaultV2/etalons/readonly-comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4fc3dfa

Please sign in to comment.