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

defaultValue not loaded correctly with customcontrols #140

Closed
sdnetwork opened this issue Jun 11, 2020 · 1 comment
Closed

defaultValue not loaded correctly with customcontrols #140

sdnetwork opened this issue Jun 11, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@sdnetwork
Copy link

Hello,

i think there is a problem with defaultValue and customcontrols, in this exemple

https://codesandbox.io/s/mui-rte-basic-im7ci?file=/src/index.js:0-683

import React from "react";
import ReactDOM from "react-dom";
import MUIRichTextEditor from "mui-rte";

const customControl = [
  {
    name: "my-style",
    type: "inline",
    inlineStyle: {
      backgroundColor: "black",
      color: "red"
    }
  }
];
const test =
  '{"blocks":[{"key":"b76h6","text":"hellllo","type":"unstyled","depth":0,"inlineStyleRanges":[{"offset":0,"length":7,"style":"MY-STYLE"}],"entityRanges":[],"data":{}}],"entityMap":{}}';

ReactDOM.render(
  <MUIRichTextEditor
    defaultValue={test}
    customControls={customControl}
    inlineToolbar={true}
    readOnly
  />,
  document.getElementById("root")
);

the hellllo text is not rendered correctly in initial load, an other strange behaviour if you click on text the style of custom control is applied ...

@niuware niuware added the bug Something isn't working label Jun 12, 2020
@niuware
Copy link
Owner

niuware commented Jun 16, 2020

@sdnetwork Thanks for reporting the issue. This is fixed on version 1.20.0.

@niuware niuware closed this as completed Jun 16, 2020
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

2 participants