diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index d1b708961a..97e9d154eb 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -816,7 +816,15 @@ export function useMultiSelect( e.preventDefault() // Replace \" with " in clipboard data - const clipboardData = e.clipboardData?.getData('text/plain') || '' + let clipboardData = e.clipboardData?.getData('text/plain') || '' + + if (clipboardData?.endsWith('\n')) { + // Remove '\n' from the end of the clipboardData + // When copying from XLS/XLSX files, there is an extra '\n' appended to the end + // this overwrites one additional cell information when we paste in NocoDB + clipboardData = clipboardData.replace(/\n$/, '') + } + try { if (clipboardData?.includes('\n') || clipboardData?.includes('\t')) { // if the clipboard data contains new line or tab, then it is a matrix or LongText