MCPcopy Create free account
hub / github.com/editablejs/editable / TableSelection

Function TableSelection

packages/plugins/table/src/components/selection.tsx:17–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17const TableSelection: React.FC<TableSelectionProps> = () => {
18 const editor = useEditableStatic()
19 const rect = useGridSelectionRect()
20
21 useIsomorphicLayoutEffect(() => {
22 if (rect) {
23 SelectionDrawing.setEnabled(editor, false)
24 } else {
25 SelectionDrawing.setEnabled(editor, true)
26 }
27
28 return () => {
29 SelectionDrawing.setEnabled(editor, true)
30 }
31 }, [editor, rect])
32
33 if (!rect) return null
34 const { top, left, width, height } = rect
35 return <SelectionStyles style={{ left, top, width, height }} />
36}
37
38export { TableSelection }

Callers

nothing calls this directly

Calls 2

useEditableStaticFunction · 0.90
useGridSelectionRectFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…