Live Preview table editor deletes text from other rows after an arrow key or app switch (trailing space in the longest cell)

Steps to reproduce

  1. Create a note with this table and view it in Live Preview:
| Item  | Notes                 |
| ----- | --------------------- |
| one   | short                 |
| two   | the longest cell here |
| three | medium text           |
| four  | more text             |
  1. Click at the very end of the longest cell here (the longest cell in its column), so the cursor is in that cell after “here”.
  2. Type a space.
  3. Press the Left arrow key.

The arrow press on its own does the damage; nothing else needs typing.

The same happens if, instead of step 4, you switch to another app and back (Cmd+Tab) and then type any letter. The Right arrow does the same when the cursor stays inside the cell. From the code, Up, Down and Cmd+Left/Right should too, again only when the cursor stays inside the cell. An arrow press that leaves the cell repairs the table instead (see below).

Did you read and follow the Troubleshooting Guide ? Yes

Expected result

The table is re-padded and no text changes, apart from the space typed.

Actual result

After the Left arrow:

| Item  | Notes                   |
| ----- | ---------------------- |
| one   | sho                     |
| two  the longest cell here  re  |
| three | medium                  |
| four  | more                    |

With an app switch and x instead:

| Item  | Notes                    |
| ----- | ----------------------- |
| one   | sho                      |
| two  the longest cell here x re  |
| three | medium                   |
| four  | more                     |

The text at the end of every other row’s cell is deleted (counting the header as line 0, the row on line n loses n characters), the edited row is written a few characters too early so its | is lost, and the separator row ends one dash short. This is silent: the damaged rows are usually not where you are looking, and in a large table they can be off screen.

It happens naturally while writing, because a cell’s text ends in a space between every two words. Typing a word and a space at the end of the longest cell, then pressing an arrow key to fix a typo, or switching apps to copy something, is enough. We hit it twice in one editing session in a real 10-row table and only noticed days later.

Workaround: if you notice it before closing the note, press Tab, or click another cell. Obsidian then rewrites the whole table from its own copy, which was never cut, and the text comes back.

Environment

SYSTEM INFO:
Obsidian version: 1.14.4
Installer version: 1.14.4
Operating system: Darwin Kernel Version 27.0.0: Tue Aug 11 21:22:49 PDT 2026; root:xnu-13432.1.9~1/RELEASE_ARM64_T6000 27.0.0
Login status: logged in
Language: en-GB
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

What we think happens, from reading app.js (method names as they appear there):

  • In the table cell editor, the keymap handlers for ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Mod-ArrowLeft and Mod-ArrowRight call table.trimCell(cell) before deciding whether the cursor leaves the cell. The cell editor’s blur DOM handler calls table.trimCell(cell) too. A window losing focus fires that blur.
  • When the cell’s text has leading or trailing whitespace, trimCell sets isMalformed and calls updateCell(cell, trimmedText). updateCell updates the cells’ start, end, padStart and padEnd and colWidths in place, and returns the changes, but trimCell discards them and leaves this.doc and the document untouched. If the cell is the widest in its column, the model’s column is now one character narrower than the document’s, so every later line’s offsets are short by one more character per line.
  • If focus stays in the cell, the next dispatchUpdate (the arrow’s own cursor move, or the next keystroke) runs updateCell again from those offsets. Each row’s padding range [end - padEnd, end) is replaced at positions shifted into its text, and the edited cell is written early. Its changes carry the table’s own annotation (rU in 1.14.5’s minified code), so receiveUpdate accepts them as the widget’s own.
  • Tab, Enter and clicking another cell go through setCellFocus, which calls dispatchTable when isMalformed is set. That rebuilds the table from the model, which is why those restore the text.

A possible fix would be for trimCell to dispatch the changes updateCell returns, as dispatchUpdate does. Another would be to leave trimming to setCellFocus, which already rebuilds a malformed table, instead of trimming on arrow keys and blur.

I can’t reproduce this. Please, download and reinstall Obsidian. Make a screen recording of this happening in the sandbox vault. Upload it somewhere and post a link here.

I’ve been dealing with tables breaking for a while but didn’t know reproducible steps. Thanks for figuring out that much, tmikus.

In the screen capture, I pressed space. Then I pressed ← three times, pausing a moment between each.

table breaks with left-arrow in a column with two trailing spaces

After more clicking around in different arrangements, so far I have it as: Table breaks when pressing left-arrow in Live Preview in a column with two trailing spaces.

SYSTEM INFO:
	Obsidian version: 1.15.0
	Installer version: 1.14.5
	Operating system: Windows 11 Pro for Workstations 10.0.26300
	Login status: logged in
	Language: en
	Catalyst license: supporter
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 0
	Plugins enabled: 0

RECOMMENDATIONS:
	none

ok thank you, I can reproduce now. We’ll look into it.