mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 15:10:06 +00:00
fix: blur textarea on Escape
This commit is contained in:
@@ -136,11 +136,13 @@
|
||||
</ModelInfoField>
|
||||
<ModelInfoField :label="$t('assetBrowser.modelInfo.description')">
|
||||
<textarea
|
||||
ref="descriptionTextarea"
|
||||
v-model="userDescription"
|
||||
:disabled="isImmutable"
|
||||
:placeholder="$t('assetBrowser.modelInfo.descriptionPlaceholder')"
|
||||
rows="3"
|
||||
class="w-full resize-y rounded-lg border border-transparent bg-transparent px-3 py-2 text-sm text-component-node-foreground outline-none transition-colors focus:bg-component-node-widget-background disabled:pointer-events-none"
|
||||
@keydown.escape.stop="descriptionTextarea?.blur()"
|
||||
/>
|
||||
</ModelInfoField>
|
||||
</PropertiesAccordionItem>
|
||||
@@ -149,7 +151,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { computed, ref, useTemplateRef, watch } from 'vue'
|
||||
|
||||
import PropertiesAccordionItem from '@/components/rightSidePanel/layout/PropertiesAccordionItem.vue'
|
||||
import TagsInput from '@/components/ui/tags-input/TagsInput.vue'
|
||||
@@ -176,6 +178,10 @@ import { cn } from '@/utils/tailwindUtil'
|
||||
|
||||
import ModelInfoField from './ModelInfoField.vue'
|
||||
|
||||
const descriptionTextarea = useTemplateRef<HTMLTextAreaElement>(
|
||||
'descriptionTextarea'
|
||||
)
|
||||
|
||||
const accordionClass = cn(
|
||||
'bg-modal-panel-background border-t border-border-default'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user