fix: autocomplete bug (#3285)

Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
This commit is contained in:
Nivedin
2023-08-24 18:46:58 +05:30
committed by GitHub
parent a8e279db28
commit a9a4ebf595
3 changed files with 5 additions and 24 deletions

View File

@@ -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"

View File

@@ -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">

View File

@@ -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>()