Nc fix: Form view bug fixes (#8322)

* fix(nc-gui): form view rich text link option issue

* chore(nc-gui): lint

* fix(nc-gui): pw test fail issue

* fix(nc-gui): add checkbox required form validation rule
This commit is contained in:
Ramesh Mane
2024-04-24 09:57:11 +05:30
committed by GitHub
parent 42e0fa6073
commit 6075611c0f
4 changed files with 58 additions and 8 deletions

View File

@@ -6,11 +6,14 @@ import type { Mark } from 'prosemirror-model'
const props = defineProps<Props>()
const emits = defineEmits(['blur'])
interface Props {
editor: Editor
isFormField?: boolean
}
const editor = computed(() => props.editor)
const { editor, isFormField } = toRefs(props)
const inputRef = ref<HTMLInputElement>()
const linkNodeMark = ref<Mark | undefined>()
@@ -164,6 +167,10 @@ const onMountLinkOptions = (e) => {
e.popper.style.width = '95%'
}
}
const tabIndex = computed(() => {
return isFormField.value ? -1 : 0
})
</script>
<template>
@@ -188,17 +195,20 @@ const onMountLinkOptions = (e) => {
<a-input
ref="inputRef"
v-model:value="href"
:tabindex="tabIndex"
class="nc-text-area-rich-link-option-input flex-1 !mx-0.5 !px-1.5 !py-0.5 !rounded-md z-10"
:bordered="false"
placeholder="Enter a link"
@change="onChange"
@press-enter="onInputBoxEnter"
@keydown="handleInputBoxKeyDown"
@blur="emits('blur')"
/>
</div>
<NcTooltip overlay-class-name="nc-text-area-rich-link-options">
<template #title> Open link </template>
<NcButton
:tabindex="tabIndex"
:class="{
'!text-gray-300 cursor-not-allowed': href.length === 0,
}"
@@ -213,6 +223,7 @@ const onMountLinkOptions = (e) => {
<NcTooltip overlay-class-name="nc-text-area-rich-link-options">
<template #title> Delete link </template>
<NcButton
:tabindex="tabIndex"
class="!duration-0 !hover:(text-red-400 bg-red-50)"
data-testid="nc-text-area-rich-link-options-open-delete"
size="small"