(event: React.TouchEvent)
| 343 | } |
| 344 | |
| 345 | const handleRootTouchStart = (event: React.TouchEvent) => { |
| 346 | if (event.defaultPrevented) return |
| 347 | if ( |
| 348 | !event.target || |
| 349 | !ref.current?.contains(event.target as DOMNode) || |
| 350 | isEditableDOMElement(event.target) || |
| 351 | inAbsoluteDOMElement(event.target) |
| 352 | ) |
| 353 | return |
| 354 | |
| 355 | const { selection } = editor |
| 356 | |
| 357 | IS_TOUCHING.set(editor, true) |
| 358 | IS_TOUCH_HOLD.set(editor, false) |
| 359 | clearTouchHoldTimer() |
| 360 | // touch hold |
| 361 | touchHoldTimer.current = setTimeout(() => { |
| 362 | IS_TOUCH_HOLD.set(editor, true) |
| 363 | |
| 364 | if (Focused.is(editor)) { |
| 365 | handleRootMouseDown(event) |
| 366 | } else if (!selection || Range.isCollapsed(selection)) { |
| 367 | IS_TOUCHING.set(editor, false) |
| 368 | const point = Editable.findEventPoint(editor, event) |
| 369 | if (point) |
| 370 | editor.selectWord({ |
| 371 | at: { |
| 372 | anchor: point, |
| 373 | focus: point, |
| 374 | }, |
| 375 | }) |
| 376 | } |
| 377 | }, 530) |
| 378 | } |
| 379 | |
| 380 | const handleRootMouseDown = (e: React.MouseEvent | React.TouchEvent) => { |
| 381 | const event = getNativeEvent(e) |
nothing calls this directly
no test coverage detected
searching dependent graphs…