Inline IsVoid block throws "Unable to find DOM node" error when selection changes
See original GitHub issueDo you want to request a feature or report a bug?
Report a bug
What’s the current behavior?
After inserting an inline block that has IsVoid in the schema, moving the selection on to the block throws an “unable to find DOM node” error. The inline component does have its incoming attributes prop spread and the schema also has IsVoid set to true. The problem does not reproduce if the button is changed to insertBlock
instead of insertInline
.
Image component
import React from "react";
export default class Image extends React.Component {
render() {
return (
<img {...this.props.attributes} src={this.props.node.data.get("src")} />
);
}
}
Schema
{
blocks: {
image: {
isVoid: true
}
}
}
What’s the expected behavior?
The editor shouldn’t crash and should allow selection.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Warning: findDOMNode is deprecated in StrictMode ...
The findDOMNode error looks like it's happening inside a library, it's not in your code. That is not a relevant warning for your...
Read more >Node.js v19.3.0 Documentation
A subclass of Error that indicates the failure of an assertion. All instances contain the built-in Error properties ( message and name )...
Read more >Changelog | Docs - TinyMCE
This is the TinyMCE Community version changelog. For information about the latest Tiny Cloud or TinyMCE Enterprise Release, see: TinyMCE Release Notes.
Read more >Rough Changelog for SeaMonkey 1.1 Alpha
It's a "rough" list because I didn't verify each bug on the list as actually ... to throw() even if exceptions are enabled...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rfeltis you inserted the image using
insertInline
but your schema is basically setting image only as a blocks. if you change your schema toor use
insertBlock
as your image then it should be good.@ianstormtaylor not sure if we want to put this as a bug. It’s more like the
isVoid
check through schema is not explained enough on the documentation. Same issue as https://github.com/ianstormtaylor/slate/issues/2219@rfeltis documentation is at https://github.com/ianstormtaylor/slate/blob/8dd919dc3457c62ea2aa72f31b83faf42cbaba72/docs/reference/slate/schema.md linked at the end of the custom normalizer section https://docs.slatejs.org/guides/schemas#custom-normalizers