From da70cafb909d143a1763cd0c5d8c7e8c24de94ff Mon Sep 17 00:00:00 2001 From: OlgaLarina Date: Mon, 1 Jul 2024 11:59:01 +0300 Subject: [PATCH] resolve #2324 Date input type location is aligned differently on identical questions --- src/question_text.ts | 2 +- tests/mask/mask_settings_tests.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/question_text.ts b/src/question_text.ts index db62215b43..796305f7fc 100644 --- a/src/question_text.ts +++ b/src/question_text.ts @@ -548,7 +548,7 @@ export class QuestionTextModel extends QuestionTextBase { private updateTextAlign(style: any) { if (this.inputTextAlignment !== "auto") { style.textAlign = this.inputTextAlignment; - } else if (this.maskSettings.getTextAlignment() !== "auto") { + } else if (!this.maskTypeIsEmpty && this.maskSettings.getTextAlignment() !== "auto") { style.textAlign = this.maskSettings.getTextAlignment(); } } diff --git a/tests/mask/mask_settings_tests.ts b/tests/mask/mask_settings_tests.ts index f81cda894d..6cb4f6bd71 100644 --- a/tests/mask/mask_settings_tests.ts +++ b/tests/mask/mask_settings_tests.ts @@ -215,6 +215,17 @@ QUnit.test("Currency mask: text aligment", function (assert) { assert.deepEqual(q.inputStyle, { width: undefined, textAlign: "left" }); }); +QUnit.test("Text aligment inputType is date, maskType is numeric", function (assert) { + const q = new QuestionTextModel("q1"); + q.fromJSON({ + "type": "text", + "name": "since-date", + "inputType": "date", + "maskType": "numeric" + }); + assert.deepEqual(q.inputStyle, { width: "" }); +}); + class IntegerMask extends InputMaskNumeric { public getType(): string { return "integermask";