draft-js-markdown-plugin icon indicating copy to clipboard operation
draft-js-markdown-plugin copied to clipboard

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

Open wrobbinz opened this issue 7 years ago • 1 comments
trafficstars

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)

wrobbinz avatar Jun 10 '18 22:06 wrobbinz

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?

juliankrispel avatar Jun 21 '18 10:06 juliankrispel