mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-09 06:30:40 +02:00
* revert #4455 / #4512; fix triple-click by unhanging range with void * added changeset
This commit is contained in:
@@ -93,6 +93,7 @@ const Image = ({ attributes, children, element }) => {
|
||||
const focused = useFocused()
|
||||
return (
|
||||
<div {...attributes}>
|
||||
{children}
|
||||
<div contentEditable={false}>
|
||||
<img
|
||||
src={element.url}
|
||||
@@ -104,7 +105,6 @@ const Image = ({ attributes, children, element }) => {
|
||||
`}
|
||||
/>
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@@ -93,7 +93,11 @@ const toggleMark = (editor, format) => {
|
||||
}
|
||||
|
||||
const isBlockActive = (editor, format) => {
|
||||
const { selection } = editor
|
||||
if (!selection) return false
|
||||
|
||||
const [match] = Editor.nodes(editor, {
|
||||
at: Editor.unhangRange(editor, selection),
|
||||
match: n =>
|
||||
!Editor.isEditor(n) && SlateElement.isElement(n) && n.type === format,
|
||||
})
|
||||
|
Reference in New Issue
Block a user