elegantthemes / Divi-Beta

8 stars 0 forks source link

Using setValue() On CodeMirror Field In Visual Builder #32

Open dtcblyth opened 1 year ago

dtcblyth commented 1 year ago

In Divi-4 I was able to set the value of CodeMirror fields in the Visual Builder Settings modal (ie. Custom CSS and Code fields) with the CodeMirror.setValue() function. For example:

// In this example, container would be a Settings modal field container.
const cm = container.querySelector('.CodeMirror').CodeMirror;
cm.setValue(someValue);

This no longer seems to work in Divi-5.

I realise this is a fringe-case but one of my extensions depends on this functionality. Any help in resolving it would be much appreciated. Thanks!

Also, see this Discord thread: https://discord.com/channels/1041765492907589683/1169445108089880796