Make images selectable on editor
This commit is contained in:
parent
5a4fe3c214
commit
2e40e12f18
@ -33,10 +33,12 @@ export const NODES = {
|
|||||||
return <a {...props.attributes} href={href}>{props.children}</a>;
|
return <a {...props.attributes} href={href}>{props.children}</a>;
|
||||||
},
|
},
|
||||||
'image': (props) => {
|
'image': (props) => {
|
||||||
const { node } = props;
|
const { node, state } = props;
|
||||||
|
const isFocused = state.selection.hasEdgeIn(node);
|
||||||
|
const className = isFocused ? styles.active : null;
|
||||||
const src = node.data.get('src');
|
const src = node.data.get('src');
|
||||||
return (
|
return (
|
||||||
<img {...props.attributes} src={src} />
|
<img {...props.attributes} src={src} className={className} />
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user