Skip to content

Commit 681d98c

Browse files
authored
Merge pull request #192 from darter/master
maxLength option for Text and LongText
2 parents bf29b88 + dc741ea commit 681d98c

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/components/QuestionTypes/LongTextType.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
v-on:focus.native="setFocus"
1414
v-on:blur.native="unsetFocus"
1515
v-bind:placeholder="placeholder"
16+
v-bind:maxlength="question.maxLength"
1617
/>
1718
</span>
1819
</template>
@@ -70,4 +71,4 @@
7071
}
7172
}
7273
}
73-
</script>
74+
</script>

src/components/QuestionTypes/TextType.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
v-bind:max="question.max"
3636
v-on:change="onChange"
3737
v-bind:placeholder="placeholder"
38+
v-bind:maxlength="question.maxLength"
3839
/>
3940
</span>
4041
</template>
@@ -59,10 +60,10 @@
5960
6061
data() {
6162
return {
62-
inputType: 'text',
63+
inputType: 'text',
6364
canReceiveFocus: true
6465
}
65-
},
66+
},
6667
6768
methods: {
6869
validate() {
@@ -82,4 +83,4 @@
8283
}
8384
}
8485
}
85-
</script>
86+
</script>

src/models/QuestionModel.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export default class QuestionModel {
102102
this.descriptionLink = []
103103
this.min = null
104104
this.max = null
105+
this.maxLength = null
105106
this.nextStepOnAnswer = false
106107

107108
Object.assign(this, options)
@@ -114,7 +115,7 @@ export default class QuestionModel {
114115
if (!this.placeholder) {
115116
this.placeholder = this.mask
116117
}
117-
}
118+
}
118119

119120
if (this.type === QuestionType.Url) {
120121
this.mask = null

0 commit comments

Comments
 (0)