Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

If first action upon loading editor is checking a list item, error is thrown #89

Open
wrobbinz opened this issue Jun 10, 2018 · 1 comment

Comments

@wrobbinz
Copy link

Description
Given an initial editor state contains a checkable-list-item, and no action has been taken on the editor (i.e. refreshed page), toggling a checkbox in the editor will throw a console error.

Steps to Reproduce

  1. Set up minimal draftjs editor with markdown plugin.
  2. Provide an initial state that contains a checkbox
  3. Before any other action, check/uncheck the box

Expected
Checkbox is toggled and no error is thrown.

Actual Result
Checkbox is checked/unchecked and an error is thrown. There may be a slight delay when checking the box (minor if so)

Uncaught TypeError: Cannot read property 'nodeType' of null
    at editOnInput (editOnInput.js:52)
    at DraftEditor.react.js:216
    at HTMLUnknownElement.callCallback (react-dom.development.js:100)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:138)
    at Object.invokeGuardedCallback (react-dom.development.js:187)
    at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:201)
    at executeDispatch (react-dom.development.js:461)
    at executeDispatchesInOrder (react-dom.development.js:483)
    at executeDispatchesAndRelease (react-dom.development.js:581)
    at executeDispatchesAndReleaseTopLevel (react-dom.development.js:592)
    at forEachAccumulated (react-dom.development.js:562)
    at runEventsInBatch (react-dom.development.js:723)
    at runExtractedEventsInBatch (react-dom.development.js:732)
    at handleTopLevel (react-dom.development.js:4472)
    at batchedUpdates$1 (react-dom.development.js:16537)
    at batchedUpdates (react-dom.development.js:2131)
    at dispatchEvent (react-dom.development.js:4551)
    at interactiveUpdates$1 (react-dom.development.js:16592)
    at interactiveUpdates (react-dom.development.js:2150)
    at dispatchInteractiveEvent (react-dom.development.js:4528)
@juliankrispel
Copy link

I can't reproduce this particular error - in fact checkable list items don't work at all for me (when loaded from raw content state), could you please provide an example via codesandbox so we can reproduce your bug?

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

2 participants