mirror of
https://github.com/facebook/lexical.git
synced 2025-05-17 15:18:47 +08:00
Documentation Update: move placeholder
examples to ContentEditable
(#7193)
This commit is contained in:
@ -113,8 +113,12 @@ function Editor() {
|
|||||||
return (
|
return (
|
||||||
<LexicalComposer initialConfig={initialConfig}>
|
<LexicalComposer initialConfig={initialConfig}>
|
||||||
<PlainTextPlugin
|
<PlainTextPlugin
|
||||||
contentEditable={<ContentEditable />}
|
contentEditable={
|
||||||
|
<ContentEditable
|
||||||
|
aria-placeholder={'Enter some text...'}
|
||||||
placeholder={<div>Enter some text...</div>}
|
placeholder={<div>Enter some text...</div>}
|
||||||
|
/>
|
||||||
|
}
|
||||||
ErrorBoundary={LexicalErrorBoundary}
|
ErrorBoundary={LexicalErrorBoundary}
|
||||||
/>
|
/>
|
||||||
<OnChangePlugin onChange={onChange} />
|
<OnChangePlugin onChange={onChange} />
|
||||||
|
@ -74,9 +74,13 @@ function Editor() {
|
|||||||
return (
|
return (
|
||||||
<LexicalComposer initialConfig={initialConfig}>
|
<LexicalComposer initialConfig={initialConfig}>
|
||||||
<PlainTextPlugin
|
<PlainTextPlugin
|
||||||
contentEditable={<ContentEditable />}
|
contentEditable={
|
||||||
|
<ContentEditable
|
||||||
|
aria-placeholder={'Enter some text...'}
|
||||||
placeholder={<div>Enter some text...</div>}
|
placeholder={<div>Enter some text...</div>}
|
||||||
/>
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
<OnChangePlugin onChange={onChange} />
|
<OnChangePlugin onChange={onChange} />
|
||||||
<HistoryPlugin />
|
<HistoryPlugin />
|
||||||
<MyCustomAutoFocusPlugin />
|
<MyCustomAutoFocusPlugin />
|
||||||
|
@ -61,8 +61,12 @@ function Editor() {
|
|||||||
return (
|
return (
|
||||||
<LexicalComposer initialConfig={initialConfig}>
|
<LexicalComposer initialConfig={initialConfig}>
|
||||||
<RichTextPlugin
|
<RichTextPlugin
|
||||||
contentEditable={<ContentEditable />}
|
contentEditable={
|
||||||
|
<ContentEditable
|
||||||
|
aria-placeholder={'Enter some text...'}
|
||||||
placeholder={<div>Enter some text...</div>}
|
placeholder={<div>Enter some text...</div>}
|
||||||
|
/>
|
||||||
|
}
|
||||||
ErrorBoundary={LexicalErrorBoundary}
|
ErrorBoundary={LexicalErrorBoundary}
|
||||||
/>
|
/>
|
||||||
<HistoryPlugin />
|
<HistoryPlugin />
|
||||||
@ -135,8 +139,12 @@ function Editor() {
|
|||||||
return (
|
return (
|
||||||
<LexicalComposer initialConfig={initialConfig}>
|
<LexicalComposer initialConfig={initialConfig}>
|
||||||
<RichTextPlugin
|
<RichTextPlugin
|
||||||
contentEditable={<ContentEditable />}
|
contentEditable={
|
||||||
|
<ContentEditable
|
||||||
|
aria-placeholder={'Enter some text...'}
|
||||||
placeholder={<div>Enter some text...</div>}
|
placeholder={<div>Enter some text...</div>}
|
||||||
|
/>
|
||||||
|
}
|
||||||
ErrorBoundary={LexicalErrorBoundary}
|
ErrorBoundary={LexicalErrorBoundary}
|
||||||
/>
|
/>
|
||||||
<HistoryPlugin />
|
<HistoryPlugin />
|
||||||
|
@ -57,8 +57,12 @@ export default function Editor() {
|
|||||||
return (
|
return (
|
||||||
<LexicalComposer initialConfig={initialConfig}>
|
<LexicalComposer initialConfig={initialConfig}>
|
||||||
<PlainTextPlugin
|
<PlainTextPlugin
|
||||||
contentEditable={<ContentEditable />}
|
contentEditable={
|
||||||
|
<ContentEditable
|
||||||
|
aria-placeholder={'Enter some text...'}
|
||||||
placeholder={<div className="editor-placeholder">Enter some text...</div>}
|
placeholder={<div className="editor-placeholder">Enter some text...</div>}
|
||||||
|
/>
|
||||||
|
}
|
||||||
ErrorBoundary={LexicalErrorBoundary}
|
ErrorBoundary={LexicalErrorBoundary}
|
||||||
/>
|
/>
|
||||||
</LexicalComposer>
|
</LexicalComposer>
|
||||||
|
@ -45,8 +45,12 @@ React wrapper for `@lexical/plain-text` that adds major features for plain text
|
|||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
<PlainTextPlugin
|
<PlainTextPlugin
|
||||||
contentEditable={<ContentEditable />}
|
contentEditable={
|
||||||
|
<ContentEditable
|
||||||
|
aria-placeholder={'Enter some text...'}
|
||||||
placeholder={<div>Enter some text...</div>}
|
placeholder={<div>Enter some text...</div>}
|
||||||
|
/>
|
||||||
|
}
|
||||||
ErrorBoundary={LexicalErrorBoundary}
|
ErrorBoundary={LexicalErrorBoundary}
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
@ -57,8 +61,12 @@ React wrapper for `@lexical/rich-text` that adds major features for rich text ed
|
|||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
<RichTextPlugin
|
<RichTextPlugin
|
||||||
contentEditable={<ContentEditable />}
|
contentEditable={
|
||||||
|
<ContentEditable
|
||||||
|
aria-placeholder={'Enter some text...'}
|
||||||
placeholder={<div>Enter some text...</div>}
|
placeholder={<div>Enter some text...</div>}
|
||||||
|
/>
|
||||||
|
}
|
||||||
ErrorBoundary={LexicalErrorBoundary}
|
ErrorBoundary={LexicalErrorBoundary}
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user