Type Editor / @type-editor/tables / input/handle-mouse-down / handleMouseDown
Function: handleMouseDown()
ts
function handleMouseDown(view, startEvent): void;Defined in: tables/src/input/handle-mouse-down.ts:40
Handles mouse down events for table cell selection.
This handler enables cell selection by dragging across table cells. It supports:
- Shift+click to extend an existing cell selection
- Click and drag to create a new cell selection
- Ignores right-click and Ctrl/Cmd+click
Parameters
| Parameter | Type | Description |
|---|---|---|
view | PmEditorView | The editor view. |
startEvent | MouseEvent | The mouse down event that initiated the interaction. |
Returns
void
Example
typescript
// Use in a ProseMirror plugin
new Plugin({
props: {
handleDOMEvents: {
mousedown: handleMouseDown,
},
},
});