smartxworks / sunmao-ui

A Framework for Developing Low-code Tool
https://sunmao-ui.com
Apache License 2.0
1.38k stars 94 forks source link

fix(CodeEditor): editing styles will override cssProperties #632

Closed xzdry closed 2 years ago

xzdry commented 2 years ago

The reason for this bug is that the UnControlled component of react-codemirror2 only updates onBlur in componentDidMount, so subsequent calls to onBlur always get the cssProperties from the component mount in the closure context, thus overriding subsequent changes to the cssProperties

tanbowensg commented 2 years ago

It is a little bit tricky. Could you add a comment in code?

xzdry commented 2 years ago

It is a little bit tricky. Could you add a comment in code?

Added