From 52faf2f3b6b7cdcdfac30aa772fb9236cf5bd81e Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:14:19 +0530 Subject: [PATCH] fix(nc-gui): disable link cell paste if link record dropdown is open (#9887) --- .../components/virtual-cell/components/LinkRecordDropdown.vue | 2 +- packages/nc-gui/composables/useMultiSelect/index.ts | 2 +- packages/nc-gui/utils/browserUtils.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/virtual-cell/components/LinkRecordDropdown.vue b/packages/nc-gui/components/virtual-cell/components/LinkRecordDropdown.vue index 9b605eb05c..18341faf82 100644 --- a/packages/nc-gui/components/virtual-cell/components/LinkRecordDropdown.vue +++ b/packages/nc-gui/components/virtual-cell/components/LinkRecordDropdown.vue @@ -63,7 +63,7 @@ watch([ncLinksDropdownRef, isOpen], () => { diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index 567b410f1e..0911f367d0 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -911,7 +911,7 @@ export function useMultiSelect( return } - if (isDrawerOrModalExist() || isExpandedCellInputExist()) { + if (isDrawerOrModalExist() || isExpandedCellInputExist() || isLinkDropdownExist()) { return } diff --git a/packages/nc-gui/utils/browserUtils.ts b/packages/nc-gui/utils/browserUtils.ts index 718d35aa09..e79cb7319c 100644 --- a/packages/nc-gui/utils/browserUtils.ts +++ b/packages/nc-gui/utils/browserUtils.ts @@ -1,6 +1,7 @@ // refer - https://stackoverflow.com/a/11752084 export const isMac = () => /Mac/i.test(navigator.platform) export const isDrawerExist = () => document.querySelector('.ant-drawer-open') +export const isLinkDropdownExist = () => document.querySelector('.nc-links-dropdown.active') export const isDrawerOrModalExist = () => document.querySelector('.ant-modal.active, .ant-drawer-open') export const isExpandedFormOpenExist = () => document.querySelector('.nc-drawer-expanded-form.active') export const isExpandedCellInputExist = () => document.querySelector('.expanded-cell-input')