mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
fix: prevent Escape key in TagsInput from closing parent modal
This commit is contained in:
@@ -23,6 +23,11 @@ const showInput = computed(() => isEditing.value || isEmpty)
|
|||||||
const { forwardRef, currentElement } = useForwardExpose()
|
const { forwardRef, currentElement } = useForwardExpose()
|
||||||
const registerFocus = inject(tagsInputFocusKey, undefined)
|
const registerFocus = inject(tagsInputFocusKey, undefined)
|
||||||
|
|
||||||
|
function handleEscape() {
|
||||||
|
currentElement.value?.blur()
|
||||||
|
isEditing.value = false
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
registerFocus?.(() => currentElement.value?.focus())
|
registerFocus?.(() => currentElement.value?.focus())
|
||||||
})
|
})
|
||||||
@@ -44,5 +49,6 @@ onUnmounted(() => {
|
|||||||
className
|
className
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
|
@keydown.escape.stop="handleEscape"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user