Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: autocomplete bug (#3285)

Nivedina9a4ebf59504
diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json
index 15494f09f..34ed67138 100644
--- a/packages/hoppscotch-common/locales/en.json
+++ b/packages/hoppscotch-common/locales/en.json
@@ -185,7 +185,6 @@
"folder": "Folder is empty",
"headers": "This request does not have any headers",
"history": "History is empty",
- "history_suggestions": "History does not have any matching entries",
"invites": "Invite list is empty",
"members": "Team is empty",
"parameters": "This request does not have any parameters",
@@ -195,7 +194,6 @@
"schema": "Connect to a GraphQL endpoint to view schema",
"shortcodes": "Shortcodes are empty",
"subscription": "Subscriptions are empty",
- "suggestions": "No matching suggestions found",
"team_name": "Team name empty",
"teams": "You don't belong to any teams",
"tests": "There are no tests for this request"
diff --git a/packages/hoppscotch-common/src/components/http/Request.vue b/packages/hoppscotch-common/src/components/http/Request.vue
index 39f99e373..beb390f7b 100644
--- a/packages/hoppscotch-common/src/components/http/Request.vue
+++ b/packages/hoppscotch-common/src/components/http/Request.vue
@@ -56,13 +56,7 @@
:inspection-results="tabResults"
@paste="onPasteUrl($event)"
@enter="newSendRequest"
- >
- <template #empty>
- <span>
- {{ t("empty.history_suggestions") }}
- </span>
- </template>
- </SmartEnvInput>
+ />
</div>
</div>
<div class="flex mt-2 sm:mt-0">
diff --git a/packages/hoppscotch-common/src/components/smart/EnvInput.vue b/packages/hoppscotch-common/src/components/smart/EnvInput.vue
index 09295173c..41efe2e42 100644
--- a/packages/hoppscotch-common/src/components/smart/EnvInput.vue
+++ b/packages/hoppscotch-common/src/components/smart/EnvInput.vue
@@ -18,7 +18,9 @@
/>
</div>
<ul
- v-if="showSuggestionPopover && autoCompleteSource"
+ v-if="
+ showSuggestionPopover && autoCompleteSource && suggestions.length > 0
+ "
ref="suggestionsMenu"
class="suggestions"
>
@@ -39,20 +41,12 @@
<span class="ml-2 truncate">to select</span>
</div>
</li>
- <li v-if="suggestions.length === 0" class="pointer-events-none">
- <div v-if="slots.empty" class="truncate py-0.5">
- <slot name="empty"></slot>
- </div>
- <span v-else class="truncate py-0.5">
- {{ t("empty.suggestions") }}
- </span>
- </li>
</ul>
</div>
</template>
<script setup lang="ts">
-import { ref, onMounted, watch, nextTick, computed, Ref, useSlots } from "vue"
+import { ref, onMounted, watch, nextTick, computed, Ref } from "vue"
import {
EditorView,
placeholder as placeholderExt,
@@ -69,7 +63,6 @@ import { HoppReactiveEnvPlugin } from "~/helpers/editor/extensions/HoppEnvironme
import { useReadonlyStream } from "@composables/stream"
import { AggregateEnvironment, aggregateEnvs$ } from "~/newstore/environments"
import { platform } from "~/platform"
-import { useI18n } from "~/composables/i18n"
import { onClickOutside, useDebounceFn } from "@vueuse/core"
import { InspectorResult } from "~/services/inspection"
import { invokeAction } from "~/helpers/actions"
@@ -111,10 +104,6 @@ const emit = defineEmits<{
(e: "click", ev: any): void
}>()
-const slots = useSlots()
-
-const t = useI18n()
-
const cachedValue = ref(props.modelValue)
const view = ref<EditorView>()