Skip to content

Fix the UI glitch when keywords are empty (#857) #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
[#886](https://github.com./nextcloud/cookbook/pull/886) @MarcelRobitaille
- Make height of control header dependant on server CSS variable
[#897](https://github.com./nextcloud/cookbook/pull/897) @MarcelRobitaille
- Fix UI glitch when keyword list is empty
[#892](https://github.com./nextcloud/cookbook/pull/892) @MarcelRobitaille

### Documentation
- Added clarification between categories and keywords for users
Expand Down
9 changes: 8 additions & 1 deletion src/components/RecipeEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,14 @@ export default {
paddedTime: this.recipe.totalTime,
}

this.selectedKeywords = this.recipe.keywords.split(",")
this.selectedKeywords = this.recipe.keywords
.split(",")
.map((kw) => kw.trim())
// Remove any empty keywords
// If the response from the server is just an empty
// string, split will create an array of a single empty
// string
.filter((kw) => kw !== "")

// fallback if fetching all keywords fails
this.selectedKeywords.forEach((kw) => {
Expand Down