1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-26 08:34:28 +02:00

fix drop on inline void node (#1376)

This commit is contained in:
Yifeng Wang
2017-11-12 07:31:50 +08:00
committed by Ian Storm Taylor
parent 8d9971afc3
commit 4e420413bb

View File

@@ -17,6 +17,14 @@ const EMOJIS = [
'🙏', '👻', '🍔', '🍑', '🍆', '🔑',
]
/**
* No ops.
*
* @type {Function}
*/
const noop = e => e.preventDefault()
/**
* The links example.
*
@@ -136,7 +144,16 @@ class Emojis extends React.Component {
case 'emoji': {
const { data } = node
const code = data.get('code')
return <span className={`emoji ${isSelected ? 'selected' : ''}`} {...props.attributes} contentEditable={false}>{code}</span>
return (
<span
className={`emoji ${isSelected ? 'selected' : ''}`}
{...props.attributes}
contentEditable={false}
onDrop={noop}
>
{code}
</span>
)
}
}
}