TableBlock shows touch and keyboard cell edits that disappear after saving
TableBlock can show keyboard edits after a touch tap but save empty cells
Observed behavior
On Wagtail 7.4.3, with the native contrib TableBlock and its bundled Handsontable 6.2.2, a single touch tap followed by keyboard input changes the displayed cell text, but saving and reopening the page loses that text. The same test passes with a desktop mouse interaction. Explicitly double-tapping a cell to open the native textarea, editing that textarea, and saving/reopening also passes.
Confirmed with Playwright 1.63.0 Chromium 153.0.8010.12 on macOS, using its Pixel 7 touch/mobile profile. This is browser touch emulation with keyboard events, not a claim that physical Android or iOS testing was performed.
Minimal setup
Add wagtail.contrib.table_block to installed apps and use a normal page body:
from wagtail.admin.panels import FieldPanel
from wagtail.contrib.table_block.blocks import TableBlock
from wagtail.fields import StreamField
from wagtail.models import Page
class TablePage(Page):
body = StreamField([("table", TableBlock())], blank=True)
content_panels = Page.content_panels + [FieldPanel("body")]The application reproduction used the same native widget, with only server-side caption validation and a reader template. It did not patch the widget or change its table options.
Reproduction
- Open a page's add/edit form with touch emulation enabled and insert a Table.
- Set headers to both and supply a caption.
- Single-tap the first body cell. Type text with a hardware keyboard; use Tab to move to other cells and type more text.
- Observe the typed text in the cells.
- Save draft and reopen the page. The typed cells are empty.
The retained automated regression typed these nine cells in order, pressing Tab
after each: Area, Owner, Support, Delivery, Coordinate, Assist, Reporting,
Maintain, Review. It asserted cell 5 visibly contained Coordinate before save;
the identical assertion after reload found the empty string. It never writes
hidden JSON or uses a widget API to populate content.
Expected: text accepted and visibly shown in an editable cell survives saving. Actual: the page saves successfully but those visible edits are absent after reload.
Source correlation
- Native keyboard access attributes make each cell contenteditable.
- Persistence
reads
hot.getData(), rather than those editable DOM cells. - Native event hooks persist Handsontable changes. The touch/keyboard path appears to edit the DOM without committing a Handsontable change. This cause is inferred from the released source and the successful native textarea control.
Bounded evidence
- Existing-widget desktop/mobile product pass: 12 passed, 1 failed; only the mobile save/reload assertion above failed.
- Focused mobile repeat plus double-tap textarea control: 2 passed (including sign-in setup), 1 failed. The single-tap loss repeated; textarea edit persisted.
- No result is claimed for Wagtail 8.0 or main, nor for physical phone browsers.
Related issues checked
Searches for TableBlock mobile, contenteditable, keyboard/save and the broader TableBlock issue history found no matching open loss report. Closed #8893 concerns reaching the widget with a keyboard. Closed #10335, #10427 and #11301 concern inability to edit a previously saved table (Wagtail 4.1–5.2); this case accepts visible new-cell input and then loses it on the initial save. These may share historical widget context, but are not claimed to be the same defect.
Source: wagtail/wagtail