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