Not working if script loaded before codemiror
See original GitHub issueDescribe the bug If the picker script is loaded before codemiror script, color picker does not appear in codemirror. This is causes some issues if the scripts loaded on-demand for both codemiror and standalone usage. On some cases standalone picker is loaded before codemiror requested for loading.
To Reproduce Load picker script before codemiror script.
Additional context A public method like “rebuildForCodemirror()” can solve the issue. Currently following section which is private, initiates picker for code mirror. A public wrapper method for this part can be triggered when needed by using the API
if (CodeMirror) {
CodeMirror.defineOption("colorpicker", false, function (cm, val, old) {
if (old && old != CodeMirror.Init) {
if (cm.state.colorpicker) {
cm.state.colorpicker.destroy();
cm.state.colorpicker = null;
}
// remove event listener
}
if (val) {
cm.state.colorpicker = new ColorView(cm, val);
}
});
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Codemirror editor is not loading content until clicked
focus(); var editor = CodeMirror. fromTextArea(document. getElementById("editor"), { mode: "text/html", height: "197px", lineNumbers: true }); ...
Read more >Issues with dynamically adding add-ons after load - CodeMirror
Hello, I have a project I'm working on that creates multiple cm instances. On initial load, CM is loaded and works great.
Read more >CodeMirror user manual
The reason that the script path has to be configured is that CodeMirror will load in a bunch of extra files when an...
Read more >CodeMirror: User Manual - FRATO
The files in the CodeMirror distribution contain shims for loading them (and their dependencies) in AMD or CommonJS environments. If the variables exports ......
Read more >Using maker.js without the CodeMirror-Editor #380 - GitHub
If I remember it right I got sometimes some issues where I had to remove something in the TypeScript - file. So far...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Perfect… Thank you.
i released v1.9.46
please see to https://codepen.io/easylogic/pen/yRPZxJ
you can use
load
function