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:
committed by
Ian Storm Taylor
parent
8d9971afc3
commit
4e420413bb
@@ -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>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user