Skip to content

Commit

Permalink
fix list empty string value (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
slavik-lvovsky authored Feb 11, 2020
1 parent 1e84013 commit c913e54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ module.exports = {
],
coverageThreshold: {
"global": {
"branches": 91.5,
"branches": 91.7,
"functions": 98.5,
"lines": 96.2,
"lines": 96.3,
"statements": 96.3
}
}
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/components/QuestionTypes/QuestionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
return undefined;
},
errorMessages() {
if (_.isEmpty(this.selected)) {
if (_.isNil(this.selected)) {
return this.clickToDisplay;
}
Expand All @@ -63,13 +63,15 @@ export default {
default: {
immediate: true,
handler: function(defaultValue) {
this.selected = defaultValue;
if (!_.isNil(defaultValue)) {
this.selected = defaultValue;
}
}
},
selected: {
immediate: true,
handler: function(selectedValue) {
this.currentQuestion.isValid = !_.isEmpty(selectedValue)
this.currentQuestion.isValid = !_.isNil(selectedValue)
this.currentQuestion.answer = selectedValue
this.updateQuestionsFromIndex(this.questionIndex)
}
Expand Down

0 comments on commit c913e54

Please sign in to comment.