Browse Source

fix/Fixed scroll issue with EditOrAdd component

pull/3495/head
Muhammed Mustafa 2 years ago
parent
commit
cf031ab12b
  1. 20
      packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue

20
packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue

@ -20,8 +20,6 @@ const advancedOptions = ref(false)
const { getMeta } = useMetas()
const editOrAddRef = ref<HTMLElement>()
const columnToValidate = [UITypes.Email, UITypes.URL, UITypes.PhoneNumber]
const onlyNameUpdateOnEditColumns = [UITypes.LinkToAnotherRecord, UITypes.Lookup, UITypes.Rollup]
@ -79,28 +77,10 @@ onMounted(() => {
formState.value.column_name = formState.value?.title
}
})
const handleClose = (e: MouseEvent) => {
const target = e.target as HTMLElement
if (
target &&
editOrAddRef?.value &&
!editOrAddRef.value.contains(target) &&
!target.closest('.ant-dropdown') &&
!target.closest('.ant-select') &&
!target.closest('.ant-select-item')
) {
emit('cancel')
}
}
useEventListener(document, 'click', handleClose)
</script>
<template>
<div
ref="editOrAddRef"
class="w-[400px] max-h-[95vh] bg-gray-50 shadow-lg p-6 overflow-auto !border"
:class="{ '!w-[600px]': formState.uidt === UITypes.Formula }"
@click.stop

Loading…
Cancel
Save