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

Allow to set customStyleMap on Editor #58

Merged
merged 1 commit into from
Jun 15, 2016
Merged

Allow to set customStyleMap on Editor #58

merged 1 commit into from
Jun 15, 2016

Conversation

andschdk
Copy link
Contributor

This PR merges the internal styleMap const and the customStyleMap prop before setting it on Editor

In README it says:

All the props you can pass to Draft.js Editor can be passed to RichTextEditor (with the exception of editorState which will be generated internally based on the value prop).

Which is not totally right. I guess there's more props which is overridden by rte, customStyleMap is just one of them.

Thanks for an awesome draftjs wrapper.

@sstur
Copy link
Owner

sstur commented Jun 15, 2016

Good catch. This PR looks good to me!

@sstur sstur merged commit 0d6dd5c into sstur:master Jun 15, 2016
@@ -78,7 +79,7 @@ export default class RichTextEditor extends Component {
<Editor
{...otherProps}
blockStyleFn={getBlockStyle}
customStyleMap={styleMap}
customStyleMap={Object.assign(styleMap, customStyleMap)}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, this mutates the global styleMap. I have to roll back this commit.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants