Sub-issue of #302 — Category E.
Goal
Verify that ContextMenuPlugin already works on touch via native long-press → contextmenu synthesis, fix any preventDefault that suppresses it, and codify the long-press priority order across plugins.
Background
Modern browsers fire contextmenu from:
- Right-click (mouse)
- Two-finger tap (macOS / Windows / iPadOS trackpad)
- Long-press (iOS Safari, Android Chrome, Windows touchscreen) — provided the page doesn't
preventDefault() touchstart or pointerdown on the target
libs/grid/src/lib/plugins/context-menu/ContextMenuPlugin.ts:523 already listens for contextmenu, so trackpad two-finger tap and right-click work today. The unknown is whether finger long-press fires contextmenu on grid cells, or whether something in cell event delegation is suppressing it.
This sub-issue is mostly verification + documentation. Likely zero or near-zero net code.
In scope
Verification
- Add Playwright touch-emulation tests that perform a 600 ms long-press on:
- If long-press does NOT fire
contextmenu on cells today, locate the offending preventDefault() (likely in event-delegation.ts or RowDragDropPlugin) and narrow it.
Long-press priority order — codify and document
Per #302's resolution policy:
| Target |
Long-press action |
Condition |
| Header |
Open header menu (#270) |
Always (when #270 registered) |
| Row |
Enter row selection mode |
When SelectionPlugin mode includes 'row' |
| Row |
Open ContextMenuPlugin |
Otherwise (or via "More…" inside selection-mode toolbar) |
| Cell |
Enter cell range-paint mode |
When SelectionPlugin mode includes 'cell' or 'range' |
| Cell |
Open ContextMenuPlugin |
Otherwise (or via "More…" inside selection-mode toolbar) |
Document this priority order in:
ContextMenuPlugin.ts JSDoc (class-level)
apps/docs/src/content/docs/grid/guides/touch-input.mdx (cross-cutting sub-issue owns this file)
ContextMenuPlugin.mdx plugin docs page
ContextMenuPlugin "More…" item in selection-mode toolbar
When both ContextMenuPlugin and SelectionPlugin are registered AND selection-mode is active (Category C), SelectionPlugin's toolbar surfaces a "More…" button that opens ContextMenuPlugin's menu — this preserves right-click parity even when long-press is consumed by selection mode.
This wiring is implemented in Category C's sub-issue; this sub-issue only documents the contract.
Out of scope
- Implementing a long-press polyfill — modern browsers handle it natively.
- Custom long-press timing per device class (single 400 ms threshold for selection mode entry; native browser handles
contextmenu timing, typically ~500 ms).
- Selection-mode toolbar implementation — Category C.
Acceptance criteria
Dependencies
References
Goal
Verify that
ContextMenuPluginalready works on touch via native long-press →contextmenusynthesis, fix any preventDefault that suppresses it, and codify the long-press priority order across plugins.Background
Modern browsers fire
contextmenufrom:preventDefault()touchstartorpointerdownon the targetlibs/grid/src/lib/plugins/context-menu/ContextMenuPlugin.ts:523already listens forcontextmenu, so trackpad two-finger tap and right-click work today. The unknown is whether finger long-press firescontextmenuon grid cells, or whether something in cell event delegation is suppressing it.This sub-issue is mostly verification + documentation. Likely zero or near-zero net code.
In scope
Verification
contextmenuevent +ContextMenuPluginmenu visibleContextMenuPluginhas row-scoped items)contextmenuon header is overriddencontextmenuon cells today, locate the offendingpreventDefault()(likely inevent-delegation.tsorRowDragDropPlugin) and narrow it.Long-press priority order — codify and document
Per #302's resolution policy:
SelectionPluginmode includes'row'ContextMenuPluginSelectionPluginmode includes'cell'or'range'ContextMenuPluginDocument this priority order in:
ContextMenuPlugin.tsJSDoc (class-level)apps/docs/src/content/docs/grid/guides/touch-input.mdx(cross-cutting sub-issue owns this file)ContextMenuPlugin.mdxplugin docs pageContextMenuPlugin"More…" item in selection-mode toolbarWhen both
ContextMenuPluginandSelectionPluginare registered AND selection-mode is active (Category C),SelectionPlugin's toolbar surfaces a "More…" button that opensContextMenuPlugin's menu — this preserves right-click parity even when long-press is consumed by selection mode.This wiring is implemented in Category C's sub-issue; this sub-issue only documents the contract.
Out of scope
contextmenutiming, typically ~500 ms).Acceptance criteria
contextmenuon cells whenContextMenuPluginis registered alone (noSelectionPlugin).contextmenuon rows when applicable.preventDefault()is currently suppressing native long-press → fix narrowed; before/after test demonstrates the regression-fix.ContextMenuPlugin.tsclass-level JSDoc documents the long-press priority order.apps/docs/src/content/docs/grid/plugins/context-menu.mdx(or equivalent) updated with a "Touch input" section linking to the touch guide.Shift+F10keyboard handling (context-menu.spec.tspasses).Dependencies
References
ContextMenuPlugin.ts:523— currentcontextmenulistenerContextMenuPlugin.ts:584— existingShift+F10keyboard handler