Fix hasDOMNode throwing error when editor is not mounted#6009
Fix hasDOMNode throwing error when editor is not mounted#6009gbalint wants to merge 1 commit intoianstormtaylor:mainfrom
Conversation
Wrap the toDOMNode call in a try-catch to gracefully handle the case where the editor is not yet mounted. In this case, the target cannot be part of the editor, so returning false is the correct behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
|
My concern is this might risk masking genuine issues. Have you considered introducing a new |
Wrap the toDOMNode call in a try-catch to gracefully handle the case where the editor is not yet mounted. In this case, the target cannot be part of the editor, so returning false is the correct behavior.
Description
A clear and concise description of what this pull request solves. (Please do not just link to a long issue thread. Instead include a clear description here or your pull request will likely not be reviewed as quickly.)
Issue
Fixes: (link to issue)
Example
A GIF or video showing the old and new behaviors after this pull request is merged. Or a code sample showing the usage of a new API. (If you don't include this, your pull request will not be reviewed as quickly, because it's much too hard to figure out exactly what is going wrong, and it makes maintenance much harder.)
Context
If your change is non-trivial, please include a description of how the new logic works, and why you decided to solve it the way you did. (This is incredibly helpful so that reviewers don't have to guess your intentions based on the code, and without it your pull request will likely not be reviewed as quickly.)
Checks
yarn test.yarn lint. (Fix errors withyarn fix.)yarn start.)yarn changeset add.)