-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Respect previewOptions className #287
Comments
react-md-editor/src/Editor.tsx Line 164 in cf68ab6
|
|
@malcolm-kee Yes, it is passed to the react-md-editor/src/Editor.tsx Line 2 in cf68ab6
|
@jaywcjlove it is not. Reproduction: https://codesandbox.io/s/markdown-editor-for-react-forked-ieyf2?file=/index.js |
<MDEditor.Markdown
source={value}
linkTarget="_blank"
+ className="red-bg"
- previewOptions={{
- // this applied but ignore
- className: "red-bg"
- }}
/> |
@jaywcjlove sorry the previous code is wrong 😅 . I just updated my example: function App() {
const [value, setValue] = React.useState(mkdStr);
return (
<div className="container">
<div className="red-bg">style applied</div>
<MDEditor
height={200}
value={value}
onChange={setValue}
previewOptions={{
// this applied but ignore
className: "red-bg"
}}
/>
</div>
);
} |
I fixed this issue. |
Thanks for the quick fix! You're awesome! |
Right now the preview className is fixed as
${prefixCls}-preview
due to https://github.com/uiwjs/react-md-editor/blob/master/src/Editor.tsx#L276.I think it should use
className
frompreviewOptions
if it is provided.If that's not what you intends, then maybe remove
className
frompreviewOptions
type definition.Either way, happy to create a PR if you can confirm the intentional behavior. Thanks!
The text was updated successfully, but these errors were encountered: