Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Uncaught TypeError: Cannot read property 'nodeType' of null at editOnInput #2204

Closed
pietrop opened this issue Oct 9, 2019 · 4 comments
Closed

Comments

@pietrop
Copy link

pietrop commented Oct 9, 2019

Do you want to request a feature or report a bug?

A bug

What is the current behavior?

DraftJs is used to power a timed transcript editor. (@bbc/react-transcript-editor) with blockRendererFn used to have a WrapperBlock to display speaker names and time-codes at paragraph level.

Trying to add a html select element to make it easier to change speaker labels within a WrapperBlock in this PR. bbc/react-transcript-editor#210

However it seems that whenever I make a selection with the select element I get this error in the coneole.

Uncaught TypeError: Cannot read property 'nodeType' of null
    at editOnInput

Screenshot 2019-10-09 at 12 38 29

I am not quiet sure what this means or it might refer to?
I found this helpful issue/comment #1085 but would love to learn more about the inner workings to understand why, if my hypothesis is right, calling select in a WrapperBlock might be triggering this?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/gmertk/e61z7nfa/.

To reproduce checkout this PR bbc/react-transcript-editor#210

  1. git clone repo / branch
git clone -b speaker-dropdown-select-2 git@github.com:pietrop/react-transcript-editor.git
  1. cd into folder - cd react-transcript-editor
  2. npm install
  3. npm start
  4. storybook starts on http://localhost:6006
  5. click button load demo
  6. click on one of the speaker names, and select a new one
  7. watch error in console

What is the expected behavior?

To not get a console error message when using select in the WrapperBlock

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

initially noticed it in 0.10.5, then updated to 0.11.1 but the message persists.

@gland2015
Copy link

wrap block children with a

,Especially when block'text.length is ''

@gland2015
Copy link

wrap block children with a div,Especially when block'text.length is ''

@skyitachi
Copy link

anchorNode can be null

facebook-github-bot pushed a commit that referenced this issue Mar 24, 2020
#2330)

Summary:
#2204
Pull Request resolved: #2330

Reviewed By: claudiopro

Differential Revision: D20582792

Pulled By: mrkev

fbshipit-source-id: d96beaa1617ef82ba5663637f5daad254d9b17f7
@mrkev
Copy link
Contributor

mrkev commented Mar 24, 2020

Merged #2330 to fix this.

@mrkev mrkev closed this as completed Mar 24, 2020
vilemj-Viclick pushed a commit to kontent-ai/draft-js that referenced this issue Jul 16, 2020
facebookarchive#2330)

Summary:
facebookarchive#2204
Pull Request resolved: facebookarchive#2330

Reviewed By: claudiopro

Differential Revision: D20582792

Pulled By: mrkev

fbshipit-source-id: d96beaa1617ef82ba5663637f5daad254d9b17f7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants