Skip to content

Desktop composer handlePaste inserts tab characters from Excel paste, messy output in contenteditable #42256

@matenkom-max

Description

@matenkom-max

Describe the bug

Pasting data from multiple Excel cells into the Hermes Desktop composer
inserts literal tab characters (\t) instead of spaces. In the
contenteditable div these tabs render as uneven column gaps instead of
readable text.

Steps to reproduce

  1. Open Hermes Desktop
  2. In Excel, copy 3 cells in one row (e.g. FEERUM | 2026-06-05 | 17,95 fp5_bear3)
  3. Paste (Ctrl+V) into the composer
  4. Text appears with tab characters between values

Expected behavior

Tabs should be replaced with spaces so pasted data reads as a clean,
single line of text.

Root cause

apps/desktop/src/app/chat/composer/index.tsx lines 492-507:

const pastedText = event.clipboardData.getData('text').trim()  // Excel provides data with \t
// ...
document.execCommand('insertText', false, pastedText)  // inserts with tabs intact

Missing .replace(/\t/g, ' ') after .trim().

Fix

const pastedText = event.clipboardData.getData('text').trim()
                             .replace(/\t/g, ' ')


## Author

Code by **Austin Pickett** (pickett.austin@gmail.com).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havetype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions