Skip to content

Beautiful Open-Source Form Builder

improve tags

JhumanJb6c9bfe1f88b
diff --git a/app/Models/Forms/Form.php b/app/Models/Forms/Form.php
index d3a61d580..11b61c99d 100644
--- a/app/Models/Forms/Form.php
+++ b/app/Models/Forms/Form.php
@@ -155,8 +155,8 @@ class Form extends Model
public function setTagsAttribute($value)
{
- if ($value == null || $value == '') {
- $value = '[]';
+ if ($value == '') {
+ $value = null;
}
$this->attributes['tags'] = json_encode($value);
}
diff --git a/resources/js/components/forms/components/VSelect.vue b/resources/js/components/forms/components/VSelect.vue
index c95fba953..a93066d2a 100644
--- a/resources/js/components/forms/components/VSelect.vue
+++ b/resources/js/components/forms/components/VSelect.vue
@@ -61,14 +61,14 @@
<slot name="option" :option="item" :selected="isSelected(item)" />
</li>
</template>
- <p v-else-if="!loading" class="w-full text-gray-500 text-center py-2">
- No option available.
+ <p v-else-if="!loading && !(allowCreation && searchTerm)" class="w-full text-gray-500 text-center py-2">
+ {{ (allowCreation ? 'Type something to add an option': 'No option available') }}.
</p>
<li v-if="allowCreation && searchTerm" role="option"
class="text-gray-900 cursor-default select-none relative py-2 pl-3 pr-9 cursor-pointer group hover:text-white hover:bg-nt-blue focus:outline-none focus:text-white focus:bg-nt-blue"
@click="createOption(searchTerm)"
- >
- Create <b class="px-1 bg-gray-300 rounded group-hover:text-black">{{searchTerm}}</b>
+ >
+ Create <b class="px-1 bg-gray-300 rounded group-hover:text-black">{{ searchTerm }}</b>
</li>
</ul>
</div>