Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(TypeError): G.preventDefault is not a function

Ramesh Mane562333f0523d
diff --git a/packages/nc-gui/components/cell/attachment/Modal.vue b/packages/nc-gui/components/cell/attachment/Modal.vue
index d7279588ea..5198f5d012 100644
--- a/packages/nc-gui/components/cell/attachment/Modal.vue
+++ b/packages/nc-gui/components/cell/attachment/Modal.vue
@@ -73,7 +73,7 @@ function onClick(item: Record<string, any>) {
// when user paste on modal
useEventListener(dropZoneRef, 'paste', (event: ClipboardEvent) => {
if (event.clipboardData?.files) {
- onDrop(event.clipboardData.files)
+ onDrop(event.clipboardData.files, {} as any)
}
})
const onFileDialogOpen = (_event) => {
diff --git a/packages/nc-gui/components/cell/attachment/utils.ts b/packages/nc-gui/components/cell/attachment/utils.ts
index 6f1c54ef51..6c2f84e97d 100644
--- a/packages/nc-gui/components/cell/attachment/utils.ts
+++ b/packages/nc-gui/components/cell/attachment/utils.ts
@@ -335,7 +335,7 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
if (droppedFiles) {
// set files
await onFileSelect(droppedFiles)
- } else {
+ } else if (event) {
event.preventDefault()
// Sanitize the dataTransfer HTML string