Skip to content

Commit

Permalink
Fix Detail field showing empty field as a value
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarpsvo committed Jun 3, 2019
1 parent c963276 commit b16046e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/js/multiselect-field.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
</div>

<div v-else>-</div>
<div v-else></div>
</template>
</panel-item>
</template>
Expand All @@ -23,7 +23,7 @@ export default {
if (!this.field.value) return;
const valuesArray = JSON.parse(this.field.value);
if (!Array.isArray(valuesArray)) return;
if (!Array.isArray(valuesArray) || !valuesArray.length) return;
return valuesArray
.map(val => this.field.options.find(opt => String(opt.value) === String(val)))
Expand Down

0 comments on commit b16046e

Please sign in to comment.