Skip to content

Commit

Permalink
[docs] Add id prop to rte
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Sep 24, 2022
1 parent ff20ce6 commit e6aa524
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions docs/src/docs/others/rte.mdx
Expand Up @@ -125,7 +125,9 @@ function Demo() {
);

const [value, onChange] = useState('');
return <RichTextEditor value={value} onChange={onChange} onImageUpload={handleImageUpload} />;
return (
<RichTextEditor value={value} onChange={onChange} onImageUpload={handleImageUpload} id="rte" />
);
}
```

Expand Down Expand Up @@ -187,7 +189,7 @@ function Demo() {
editorRef.current.focus();
}, []);

return <RichTextEditor ref={editorRef} {...otherProps} />;
return <RichTextEditor ref={editorRef} id="rte" {...otherProps} />;
}
```

Expand Down Expand Up @@ -242,7 +244,7 @@ Then when you want to use `RichTextEditor` import your component instead:
import RichTextEditor from '../components/RichText';

function MyPage() {
return <RichTextEditor />;
return <RichTextEditor id="rte" />;
}
```

Expand Down
Expand Up @@ -9,6 +9,7 @@ function Demo() {
const [value, onChange] = useState('<p>Rich text editor content</p>');
return (
<RichTextEditor
id="rte"
value={value}
onChange={onChange}
formats={['bold', 'italic', 'underline']}
Expand Down
Expand Up @@ -38,6 +38,7 @@ function Demo() {
return (
<RichTextEditor
id="rte"
value={value}
onChange={onChange}
placeholder="Type @ or # to see mentions autocomplete"
Expand Down
Expand Up @@ -6,7 +6,7 @@ export const html = `
`;

const code = `
<RichTextEditor readOnly {...otherProps} />
<RichTextEditor readOnly id="rte" {...otherProps} />
`;

function Demo(props: any) {
Expand Down
Expand Up @@ -10,7 +10,7 @@ const initialValue =
function Demo() {
const [value, onChange] = useState(initialValue);
return <RichTextEditor value={value} onChange={onChange} />;
return <RichTextEditor value={value} onChange={onChange} id="rte" />;
}
`;

Expand Down
Expand Up @@ -4,6 +4,7 @@ import { DEFAULT_CONTROLS, DEFAULT_LABELS, Toolbar } from '@mantine/rte';

const code = `
<RichTextEditor
id="rte"
controls={[
['bold', 'italic', 'underline', 'link', 'image'],
['unorderedList', 'h1', 'h2', 'h3'],
Expand Down

0 comments on commit e6aa524

Please sign in to comment.