Browse Source

fix: Attachment UX mobile issue with gallery fixed

pull/6723/head
Muhammed Mustafa 1 year ago
parent
commit
f0e4a9118a
  1. 23
      packages/nc-gui/components/cell/attachment/index.vue

23
packages/nc-gui/components/cell/attachment/index.vue

@ -153,12 +153,6 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e) => {
const rowHeight = inject(RowHeightInj, ref())
const open = (e: Event) => {
// if (isMobileMode.value && !isExpandedForm.value) {
// isExpandedForm.value = true
// return
// }
e.stopPropagation()
_open()
@ -179,6 +173,14 @@ const onExpand = () => {
modalVisible.value = true
}
const onImageClick = (item: any) => {
if (isMobileMode.value && !isExpandedForm.value) return
if (!isMobileMode.value && (isGallery.value || (isKanban.value && !isExpandedForm.value))) return
selectedImage.value = item
}
</script>
<template>
@ -258,14 +260,7 @@ const onExpand = () => {
<div
class="nc-attachment flex items-center flex-col flex-wrap justify-center"
:class="{ 'ml-2': active }"
@click="
() => {
if (isGallery || (isKanban && !isExpandedForm)) return
if (isMobileMode && !isExpandedForm) return
selectedImage = item
}
"
@click="() => onImageClick(item)"
>
<LazyCellAttachmentImage
:alt="item.title || `#${i}`"

Loading…
Cancel
Save