question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inline IsVoid block throws "Unable to find DOM node" error when selection changes

See original GitHub issue

Do 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
    }
  }
}

Codesandbox example

Image of bug

What’s the expected behavior?

The editor shouldn’t crash and should allow selection.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
isubasticommented, Oct 31, 2018

@rfeltis you inserted the image using insertInlinebut your schema is basically setting image only as a blocks. if you change your schema to

{
  inlines: {
    image: {
      isVoid: true
    }
  }
}

or 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

Read more comments on GitHub >

github_iconTop 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 >
API Reference | Vitest
A blazing fast unit test framework powered by Vite.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found