diff --git a/LICENSE b/LICENSE index 3d88d01..115e637 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Dan Elbert +Copyright (c) 2018 Dan Elbert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/javascript/components/AppAutocomplete.vue b/app/javascript/components/AppAutocomplete.vue index 25e3b60..7a9919e 100644 --- a/app/javascript/components/AppAutocomplete.vue +++ b/app/javascript/components/AppAutocomplete.vue @@ -11,6 +11,7 @@ :value="rawValue" :class="finalInputClass" + @click="clickHandler" @blur="blurHandler" @input="inputHandler" @keydown="keydownHandler" @@ -129,6 +130,10 @@ this.activeListIndex = idx; }, + clickHandler(evt) { + this.$emit("inputClick", evt); + }, + blurHandler(evt) { // blur fires before click. If the blur was fired because the user clicked a list item, immediately hiding the list here // would prevent the click event from firing diff --git a/app/javascript/components/RecipeEditIngredientItem.vue b/app/javascript/components/RecipeEditIngredientItem.vue index cb7c788..3b04797 100644 --- a/app/javascript/components/RecipeEditIngredientItem.vue +++ b/app/javascript/components/RecipeEditIngredientItem.vue @@ -22,6 +22,7 @@ valueAttribute="name" labelAttribute="name" placeholder="" + @inputClick="nameClick" @optionSelected="searchItemSelected" :onGetOptions="updateSearchItems" > @@ -72,6 +73,12 @@ this.ingredient.ingredient_id = ingredient.id; this.ingredient.ingredient = ingredient; this.ingredient.name = ingredient.name; + }, + + nameClick() { + if (this.ingredient.ingredient_id === null && this.ingredient.name !== null && this.ingredient.name.length > 2) { + this.$refs.autocomplete.updateOptions(this.ingredient.name); + } } }, diff --git a/app/javascript/components/TheAboutPage.vue b/app/javascript/components/TheAboutPage.vue index b49d99e..0488ece 100644 --- a/app/javascript/components/TheAboutPage.vue +++ b/app/javascript/components/TheAboutPage.vue @@ -1,5 +1,22 @@