mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 06:01:24 +02:00
Add optional id
prop to the Editor
component (#2402)
This commit is contained in:
committed by
Ian Storm Taylor
parent
eb79c3dbff
commit
13107b0c43
@@ -41,6 +41,7 @@ class Content extends React.Component {
|
||||
autoCorrect: Types.bool.isRequired,
|
||||
className: Types.string,
|
||||
editor: Types.object.isRequired,
|
||||
id: Types.string,
|
||||
readOnly: Types.bool.isRequired,
|
||||
role: Types.string,
|
||||
spellCheck: Types.bool.isRequired,
|
||||
@@ -421,6 +422,7 @@ class Content extends React.Component {
|
||||
render() {
|
||||
const { props, handlers } = this
|
||||
const {
|
||||
id,
|
||||
className,
|
||||
readOnly,
|
||||
editor,
|
||||
@@ -467,6 +469,7 @@ class Content extends React.Component {
|
||||
data-key={document.key}
|
||||
contentEditable={readOnly ? null : true}
|
||||
suppressContentEditableWarning
|
||||
id={id}
|
||||
className={className}
|
||||
autoCorrect={props.autoCorrect ? 'on' : 'off'}
|
||||
spellCheck={spellCheck}
|
||||
|
@@ -35,6 +35,7 @@ class Editor extends React.Component {
|
||||
autoCorrect: Types.bool,
|
||||
autoFocus: Types.bool,
|
||||
className: Types.string,
|
||||
id: Types.string,
|
||||
onChange: Types.func,
|
||||
options: Types.object,
|
||||
placeholder: Types.any,
|
||||
|
1
packages/slate-react/src/plugins/react.js
vendored
1
packages/slate-react/src/plugins/react.js
vendored
@@ -60,6 +60,7 @@ function ReactPlugin(options = {}) {
|
||||
autoCorrect={props.autoCorrect}
|
||||
className={props.className}
|
||||
editor={editor}
|
||||
id={props.id}
|
||||
onEvent={(handler, event) => editor.run(handler, event)}
|
||||
readOnly={props.readOnly}
|
||||
role={props.role}
|
||||
|
Reference in New Issue
Block a user