Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing enter at the end of a line within a code block throws an error #104

Closed
thibaudcolas opened this issue Nov 15, 2017 · 1 comment
Closed
Labels
bug Something isn't working
Milestone

Comments

@thibaudcolas
Copy link
Collaborator

thibaudcolas commented Nov 15, 2017

See behavior below:

code-block-insertion

I imagine this may be because of the code block having a wrapper:

renderMap[BLOCK_TYPE.CODE] = {
element: 'code',
wrapper: DefaultDraftBlockRenderMap.get(BLOCK_TYPE.CODE)
.wrapper,
};

This might not be compatible with how draftjs-utils handles newlines: https://github.com/jpuri/draftjs-utils/blob/0ca605084a64a0fddb62d680918aad4bea1400a2/js/keyPress.js#L63

@thibaudcolas thibaudcolas added the bug Something isn't working label Nov 15, 2017
@thibaudcolas thibaudcolas added this to the Post v1.0.0 milestone Nov 15, 2017
@thibaudcolas
Copy link
Collaborator Author

This isn't related to the block having a wrapper, this is because of how tryToRemoveBlockStyle from Draft.js is used. Corresponding draftjs-utils issue: jpuri/draftjs-utils#10.

@thibaudcolas thibaudcolas modified the milestones: Post v1.0.0, v1.0.0 Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant