mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-28 17:39:57 +02:00
Handle readOnly inside contentEditable check list (#1689)
This commit is contained in:
committed by
Ian Storm Taylor
parent
35f101c80f
commit
7cf6e1d5a8
@@ -31,7 +31,7 @@ class CheckListItem extends React.Component {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { attributes, children, node } = this.props
|
const { attributes, children, node, readOnly } = this.props
|
||||||
const checked = node.data.get('checked')
|
const checked = node.data.get('checked')
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -42,7 +42,7 @@ class CheckListItem extends React.Component {
|
|||||||
<span>
|
<span>
|
||||||
<input type="checkbox" checked={checked} onChange={this.onChange} />
|
<input type="checkbox" checked={checked} onChange={this.onChange} />
|
||||||
</span>
|
</span>
|
||||||
<span contentEditable suppressContentEditableWarning>
|
<span contentEditable={!readOnly} suppressContentEditableWarning>
|
||||||
{children}
|
{children}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user