Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Nov 28, 2024
1 parent 62adbe9 commit 4b1ea0d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/www/content/docs/cursor-overlay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ const plugins = [
];
```

### Editor Container

The editor requires a container component above `PlateContent` to ensure correct cursor overlay positioning:

```tsx
export const EditorContainer = (props: React.HTMLAttributes<HTMLDivElement>) => {
const editor = useEditorRef();
const containerRef = useEditorContainerRef();

return <div id={editor.uid} ref={containerRef} {...props} />;
};
```

This component is available in [Editor](/docs/components/editor).

### Preserving Selection Focus

To maintain the editor's selection state when focusing UI elements, add the `data-plate-focus="true"` attribute to those elements:
Expand Down

0 comments on commit 4b1ea0d

Please sign in to comment.