Skip to content

Commit bf5ee39

Browse files
Merge pull request #892 from MarcelRobitaille/fix-ui-glitch-empty-keywords
Fix the UI glitch when keywords are empty (#857)
2 parents 3c27626 + 17d4e86 commit bf5ee39

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
[#886](https://github.com/nextcloud/cookbook/pull/886) @MarcelRobitaille
2020
- Make height of control header dependant on server CSS variable
2121
[#897](https://github.com/nextcloud/cookbook/pull/897) @MarcelRobitaille
22+
- Fix UI glitch when keyword list is empty
23+
[#892](https://github.com/nextcloud/cookbook/pull/892) @MarcelRobitaille
2224

2325
### Documentation
2426
- Added clarification between categories and keywords for users

src/components/RecipeEdit.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,14 @@ export default {
667667
paddedTime: this.recipe.totalTime,
668668
}
669669
670-
this.selectedKeywords = this.recipe.keywords.split(",")
670+
this.selectedKeywords = this.recipe.keywords
671+
.split(",")
672+
.map((kw) => kw.trim())
673+
// Remove any empty keywords
674+
// If the response from the server is just an empty
675+
// string, split will create an array of a single empty
676+
// string
677+
.filter((kw) => kw !== "")
671678
672679
// fallback if fetching all keywords fails
673680
this.selectedKeywords.forEach((kw) => {

0 commit comments

Comments
 (0)