* Get the target point from a DOM `event`.
(editor: Editor, event: any)
| 669 | * Get the target point from a DOM `event`. |
| 670 | */ |
| 671 | findEventPoint(editor: Editor, event: any): Point | null { |
| 672 | event = getNativeEvent(event) |
| 673 | const { clientX: x, clientY: y } = event |
| 674 | |
| 675 | if (x == null || y == null) { |
| 676 | throw new Error(`Cannot resolve a Editor range from a DOM event: ${event}`) |
| 677 | } |
| 678 | let target = event.target |
| 679 | if (isTouch(event)) { |
| 680 | target = document.elementFromPoint(event.clientX, event.clientY) |
| 681 | } |
| 682 | return Editable.findClosestPoint(editor, target, x, y) |
| 683 | }, |
| 684 | |
| 685 | findPreviousLinePoint(editor: Editor, at?: Range): Point | null { |
| 686 | const { selection } = editor |
nothing calls this directly
no test coverage detected
searching dependent graphs…