Skip to content

Commit

Permalink
Merge pull request #18814 from mvdbeek/fix_library_edit_field_null_ha…
Browse files Browse the repository at this point in the history
…ndling

[24.1] Fix optional text handling in LibraryEditField
  • Loading branch information
martenson authored Sep 16, 2024
2 parents 310cbd9 + 9afea55 commit f1b86ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/src/components/Libraries/LibraryEditField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<b-form-textarea class="form-control" :value="text" rows="3" no-resize @change="updateValue" />
</div>
<!-- shrink long text -->
<div v-else-if="text.length > maxDescriptionLength && !isExpanded">
<div v-else-if="text && text.length > maxDescriptionLength && !isExpanded">
<!-- eslint-disable vue/no-v-html -->
<span
class="shrinked-description"
Expand All @@ -20,10 +20,10 @@
<!-- Regular -->
<div v-else>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-html="linkify(sanitize(text))"></div>
<div v-html="linkify(sanitize(text ?? ''))"></div>
<!-- hide toggle expand if text is too short -->
<a
v-if="text.length > maxDescriptionLength"
v-if="text && text.length > maxDescriptionLength"
class="more-text-btn"
href="javascript:void(0)"
@click="toggleDescriptionExpand"
Expand All @@ -47,6 +47,7 @@ export default {
props: {
text: {
type: String,
required: false,
},
changedValue: {
type: String,
Expand Down

0 comments on commit f1b86ee

Please sign in to comment.