Skip to content

Commit

Permalink
resolve #2324 Date input type location is aligned differently on iden…
Browse files Browse the repository at this point in the history
…tical questions
  • Loading branch information
OlgaLarina committed Jul 1, 2024
1 parent 4728dc2 commit da70caf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/question_text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
11 changes: 11 additions & 0 deletions tests/mask/mask_settings_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit da70caf

Please sign in to comment.