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

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

@pietrop

Description

@pietrop

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions