File tree Expand file tree Collapse file tree 5 files changed +26
-5
lines changed Expand file tree Collapse file tree 5 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 7171 v-bind:aria-label =" language.ariaOk"
7272 >
7373 <span v-if =" question.type === QuestionType.SectionBreak" >{{ language.continue }}</span >
74- <span v-else >{{ language.ok }}</span >
74+ <span v-else >
75+ <span v-if =" showSkip()" >{{ language.skip }}</span >
76+ <span v-else >{{ language.ok }}</span >
77+ </span >
7578 </button >
7679 <a
7780 class =" f-enter-desc"
245248 return this .active
246249 }
247250
251+ if (! this .question .required ) {
252+ return true
253+ }
254+
248255 if (this .question .allowOther && this .question .other ) {
249256 return true
250257 }
262269 return q .hasValue && q .isValid ()
263270 },
264271
272+ showSkip () {
273+ const q = this .$refs .questionComponent
274+
275+ return q && ! this .question .required && ! q .hasValue
276+ },
277+
265278 /**
266279 * Determins if the invalid message should be shown.
267280 */
Original file line number Diff line number Diff line change 1818 },
1919 methods: {
2020 validate () {
21- return this .hasValue && / ^ [^ @] + @. + [^ . ] $ / .test (this .dataValue )
21+ if (this .hasValue ) {
22+ return / ^ [^ @] + @. + [^ . ] $ / .test (this .dataValue )
23+ }
24+
25+ return ! this .question .required
2226 }
2327 }
2428 }
Original file line number Diff line number Diff line change 6767
6868 methods: {
6969 validate () {
70- if (this .question .mask && this .dataValue .length !== this .question .mask .length ) {
70+ if (this .question .mask && this .hasValue && this . dataValue .length !== this .question .mask .length ) {
7171 return false
7272 }
7373
Original file line number Diff line number Diff line change 3333 var url = new URL (this .fixAnswer (this .dataValue ))
3434
3535 return true
36- } catch (_) { /* Invalid URL */ }
36+ } catch (_) {
37+ // Invalid URL
38+ return false
39+ }
3740 }
3841
39- return false
42+ return ! this . question . required
4043 }
4144 }
4245 }
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export default class LanguageModel {
1212 this . shiftKey = 'Shift'
1313 this . ok = 'OK'
1414 this . continue = 'Continue'
15+ this . skip = 'Skip'
1516 this . pressEnter = 'Press :enterKey'
1617 this . multipleChoiceHelpText = 'Choose as many as you like'
1718 this . multipleChoiceHelpTextSingle = 'Choose only one answer'
You can’t perform that action at this time.
0 commit comments